Skip to content

Commit

Permalink
Merge branch 'main' into feat/app-shell
Browse files Browse the repository at this point in the history
  • Loading branch information
jthrilly authored Jun 7, 2024
2 parents e1bbe36 + 7d57728 commit 346609e
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions drizzle/schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
date,
integer,
json,
pgTable,
serial,
text,
Expand All @@ -24,58 +22,12 @@ export const projects = pgTable('projects', {

export const protocols = pgTable('protocols', {
id: serial('id').primaryKey(),
hash: text('hash').notNull().unique(),
name: text('name').notNull(),
schemaVersion: integer('schema_version').notNull(),
description: text('description'),
importedAt: date('imported_at').notNull().defaultNow(),
lastModified: date('last_modified').notNull(),
stages: json('stages').notNull(),
codebook: json('codebook').notNull(),
projectId: serial('project_id').references(() => projects.id, {
onDelete: 'cascade',
}),
});

export const protocolsAssets = pgTable('protocols_assets', {
protocolId: serial('protocol_id').references(() => protocols.id, {
onDelete: 'cascade',
}),
assetId: text('asset_id').references(() => assets.assetId, {
onDelete: 'cascade',
}),
});

export const assets = pgTable('assets', {
key: text('key').primaryKey(),
assetId: text('asset_id').notNull().unique(),
name: text('name').notNull(),
type: text('type').notNull(),
url: text('url').notNull(),
size: integer('size').notNull(),
});

export const interviews = pgTable('interviews', {
id: text('id').primaryKey(),
startTime: date('start_time').notNull().defaultNow(),
finishTime: date('finish_time'),
exportTime: date('export_time'),
lastUpdated: date('last_updated').notNull().defaultNow(),
network: json('network').notNull(),
participantId: text('participant_id').references(() => participants.id, {
onDelete: 'cascade',
}),
protocolId: text('protocol_id').references(() => protocols.id, {
onDelete: 'cascade',
}),
currentStep: integer('current_step').notNull().default(0),
stageMetadata: json('stage_metadata'),
});

export const participants = pgTable('participants', {
id: text('id').primaryKey(),
identifier: text('identifier').notNull().unique(),
label: text('label'),
});

export type Project = typeof projects.$inferSelect;

0 comments on commit 346609e

Please sign in to comment.