Add groupId column and FilesGroupTable schema
Added the `groupId` column to the existing table to link with the new `FilesGroupTable`. The `FilesGroupTable` includes a unique identifier and a unique group name to manage file groups effectively.
This commit is contained in:
parent
d4a224614e
commit
f2a45ce271
@ -68,6 +68,10 @@ export const FilesTable = pgTable("files", {
|
|||||||
.default("anonyme")
|
.default("anonyme")
|
||||||
.notNull(),
|
.notNull(),
|
||||||
|
|
||||||
|
groupId: p
|
||||||
|
.uuid("group_id")
|
||||||
|
.references(()=> FilesGroupTable.uuid),
|
||||||
|
|
||||||
fileSize: p.integer("file_size").notNull(),
|
fileSize: p.integer("file_size").notNull(),
|
||||||
|
|
||||||
//TODO Replace by file type reference
|
//TODO Replace by file type reference
|
||||||
@ -92,6 +96,18 @@ export const FilesTable = pgTable("files", {
|
|||||||
.notNull(),
|
.notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const FilesGroupTable = pgTable("f_groups", {
|
||||||
|
// Unique identifier on a technical aspect.
|
||||||
|
uuid: p.uuid("uuid").unique().primaryKey().defaultRandom().notNull(),
|
||||||
|
|
||||||
|
groupName: p
|
||||||
|
.varchar("group_name", {
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
.unique()
|
||||||
|
.notNull(),
|
||||||
|
})
|
||||||
|
|
||||||
//TODO Files types
|
//TODO Files types
|
||||||
export const FilesTypesTable = pgTable("f_types", {
|
export const FilesTypesTable = pgTable("f_types", {
|
||||||
//uuid
|
//uuid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user