Add checksum field and unique constraint on type_name
Added a new 'checksum' field with a length of 64 characters to ensure data integrity. Additionally, enforced uniqueness on the 'type_name' to prevent duplicate entries.
This commit is contained in:
parent
bdadf51e54
commit
d42aaeda05
@ -61,11 +61,14 @@ export const FilesTable = pgTable("files", {
|
|||||||
})
|
})
|
||||||
.notNull(),
|
.notNull(),
|
||||||
|
|
||||||
|
checksum: p.varchar("checksum", {
|
||||||
|
length: 64
|
||||||
|
}).notNull(),
|
||||||
|
|
||||||
uploader: p
|
uploader: p
|
||||||
.varchar("uploader", {
|
.varchar("uploader", {
|
||||||
length: 64,
|
length: 64,
|
||||||
})
|
})
|
||||||
.default("anonyme")
|
|
||||||
.notNull(),
|
.notNull(),
|
||||||
|
|
||||||
groupId: p
|
groupId: p
|
||||||
@ -117,6 +120,7 @@ export const FilesTypesTable = pgTable("f_types", {
|
|||||||
.varchar("type_name", {
|
.varchar("type_name", {
|
||||||
length: 64,
|
length: 64,
|
||||||
})
|
})
|
||||||
|
.unique()
|
||||||
.notNull(),
|
.notNull(),
|
||||||
|
|
||||||
mime: p
|
mime: p
|
||||||
|
Loading…
x
Reference in New Issue
Block a user