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:
Mathis H (Avnyr) 2024-09-24 12:28:53 +02:00
parent bdadf51e54
commit d42aaeda05
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -61,11 +61,14 @@ export const FilesTable = pgTable("files", {
})
.notNull(),
checksum: p.varchar("checksum", {
length: 64
}).notNull(),
uploader: p
.varchar("uploader", {
length: 64,
})
.default("anonyme")
.notNull(),
groupId: p
@ -117,6 +120,7 @@ export const FilesTypesTable = pgTable("f_types", {
.varchar("type_name", {
length: 64,
})
.unique()
.notNull(),
mime: p