Changeset 1ebac59 for database/drizzle/schema/builds.ts
- Timestamp:
- 12/20/25 00:55:47 (7 months ago)
- Branches:
- main
- Children:
- b69759d
- Parents:
- c30935a
- File:
-
- 1 edited
-
database/drizzle/schema/builds.ts (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
database/drizzle/schema/builds.ts
rc30935a r1ebac59 3 3 import { componentsTable } from "./components"; 4 4 5 export const build Table = pgTable("build", {5 export const buildsTable = pgTable("build", { 6 6 id: serial("id").primaryKey(), 7 7 userId: integer("user_id") … … 15 15 }); 16 16 17 export const buildComponent Table = pgTable("build_component", {17 export const buildComponentsTable = pgTable("build_component", { 18 18 buildId: integer("build_id") 19 19 .notNull() 20 .references(() => build Table.id, { onDelete: "cascade", onUpdate: "cascade" }),20 .references(() => buildsTable.id, { onDelete: "cascade", onUpdate: "cascade" }), 21 21 componentId: integer("component_id") 22 22 .notNull() … … 28 28 ); 29 29 30 export const favoriteBuild Table = pgTable("favorite_build", {30 export const favoriteBuildsTable = pgTable("favorite_build", { 31 31 buildId: integer("build_id") 32 32 .notNull() 33 .references(() => build Table.id, { onDelete: "cascade", onUpdate: "cascade" }),33 .references(() => buildsTable.id, { onDelete: "cascade", onUpdate: "cascade" }), 34 34 userId: integer("user_id") 35 35 .notNull() … … 41 41 ); 42 42 43 export const ratingBuild Table = pgTable("rating_build", {43 export const ratingBuildsTable = pgTable("rating_build", { 44 44 buildId: integer("build_id") 45 45 .notNull() 46 .references(() => build Table.id, { onDelete: "cascade", onUpdate: "cascade" }),46 .references(() => buildsTable.id, { onDelete: "cascade", onUpdate: "cascade" }), 47 47 userId: integer("user_id") 48 48 .notNull() … … 55 55 ); 56 56 57 export const review Table = pgTable("review", {57 export const reviewsTable = pgTable("review", { 58 58 id: serial("id").primaryKey(), 59 59 60 60 buildId: integer("build_id") 61 61 .notNull() 62 .references(() => build Table.id, { onDelete: "cascade", onUpdate: "cascade" }),62 .references(() => buildsTable.id, { onDelete: "cascade", onUpdate: "cascade" }), 63 63 userId: integer("user_id") 64 64 .notNull() … … 68 68 }); 69 69 70 export type buildItem = typeof build Table.$inferSelect;71 export type buildInsert = typeof build Table.$inferInsert;70 export type buildItem = typeof buildsTable.$inferSelect; 71 export type buildInsert = typeof buildsTable.$inferInsert; 72 72 73 export type buildComponentItem = typeof buildComponent Table.$inferSelect;74 export type buildComponentInsert = typeof buildComponent Table.$inferInsert;73 export type buildComponentItem = typeof buildComponentsTable.$inferSelect; 74 export type buildComponentInsert = typeof buildComponentsTable.$inferInsert; 75 75 76 export type favoriteBuildItem = typeof favoriteBuild Table.$inferSelect;77 export type favoriteBuildInsert = typeof favoriteBuild Table.$inferInsert;76 export type favoriteBuildItem = typeof favoriteBuildsTable.$inferSelect; 77 export type favoriteBuildInsert = typeof favoriteBuildsTable.$inferInsert; 78 78 79 export type ratingBuildItem = typeof ratingBuild Table.$inferSelect;80 export type ratingBuildInsert = typeof ratingBuild Table.$inferInsert;79 export type ratingBuildItem = typeof ratingBuildsTable.$inferSelect; 80 export type ratingBuildInsert = typeof ratingBuildsTable.$inferInsert; 81 81 82 export type reviewItem = typeof review Table.$inferSelect;83 export type reviewInsert = typeof review Table.$inferInsert;82 export type reviewItem = typeof reviewsTable.$inferSelect; 83 export type reviewInsert = typeof reviewsTable.$inferInsert;
Note:
See TracChangeset
for help on using the changeset viewer.
