Skip to content

Commit

Permalink
Merge pull request #23 from hubcio2115/feat/video-entry-table
Browse files Browse the repository at this point in the history
Db schema for videos
  • Loading branch information
Ciszkoo committed Jan 6, 2024
2 parents 3c26cdf + afe9f43 commit a36e187
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/server/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const users = mysqlTable("user", {

export const usersRelations = relations(users, ({ many }) => ({
accounts: many(accounts),
videoEntries: many(videoEntries),
}));

export const accounts = mysqlTable(
Expand Down Expand Up @@ -107,3 +108,21 @@ export const verificationTokens = mysqlTable(
compoundKey: primaryKey(vt.identifier, vt.token),
}),
);

export const videoEntries = mysqlTable("videoEntry", {
id: bigint("id", { mode: "number" }).primaryKey().autoincrement(),
uploadId: varchar("uploadId", { length: 256 }).notNull(),
assetId: varchar("assetId", { length: 256 }),
downloadUrl: varchar("url", { length: 256 }),
// projectId: bigint("projectId", { mode: "number" }).references(() => project.id),
authorId: varchar("id", { length: 255 })
.notNull()
.references(() => users.id),
});

export const videoEntriesRelations = relations(videoEntries, ({ one }) => ({
author: one(users, {
fields: [videoEntries.authorId],
references: [users.id],
}),
}));

0 comments on commit a36e187

Please sign in to comment.