Update schema to remove default values and add new table
Removed default values for 'isRestricted' and 'isDocumentation' columns in the FilesTable. Added a new intermediary table 'FilesForMachinesTable' to establish a many-to-many relationship between 'File' and 'Machine'.
This commit is contained in:
parent
65118e9465
commit
ceef9f94b6
@ -83,9 +83,9 @@ export const FilesTable = pgTable("files", {
|
||||
.notNull()
|
||||
.references(() => FilesTypesTable.id),
|
||||
|
||||
isRestricted: p.boolean("is_restricted").default(false).notNull(),
|
||||
isRestricted: p.boolean("is_restricted").notNull(),
|
||||
|
||||
isDocumentation: p.boolean("is_documentation").default(false).notNull(),
|
||||
isDocumentation: p.boolean("is_documentation").notNull(),
|
||||
|
||||
uploadedAt: p
|
||||
.timestamp("uploaded_at", {
|
||||
@ -151,6 +151,19 @@ export const MachinesTable = pgTable("machines", {
|
||||
//supported files format
|
||||
});
|
||||
|
||||
//TODO Many to Many table betwen File en Machine
|
||||
export const FilesForMachinesTable = pgTable("files_for_machines", {
|
||||
fileId: p
|
||||
.uuid("file_id")
|
||||
.notNull()
|
||||
.references(() => FilesTable.uuid),
|
||||
|
||||
machineId: p
|
||||
.uuid("machine_id")
|
||||
.notNull()
|
||||
.references(() => MachinesTable.id),
|
||||
});
|
||||
|
||||
export const FilesTypeForMachine = pgTable("f_type_for_machines", {
|
||||
machineId: p
|
||||
.uuid("machine_id")
|
||||
|
Loading…
x
Reference in New Issue
Block a user