add archived to files on delete

This commit is contained in:
OxSaitama 2023-05-11 11:07:59 +02:00
parent 6904d1be02
commit 9c84f99598
5 changed files with 9 additions and 3 deletions

View File

@ -48,7 +48,7 @@
"cors": "^2.8.5",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.0",
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.46",
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47",
"module-alias": "^2.2.2",
"multer": "^1.4.5-lts.1",
"next": "^13.1.5",

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "files" ADD COLUMN "archived_at" TIMESTAMP(3);

View File

@ -39,7 +39,7 @@ model Contacts {
cell_phone_number String @unique @db.VarChar(50)
civility ECivility @default(MALE)
address Addresses? @relation(fields: [address_uid], references: [uid], onDelete: Cascade)
address_uid String? @unique @db.VarChar(255)
address_uid String? @unique @db.VarChar(255)
birthdate DateTime?
created_at DateTime? @default(now())
updated_at DateTime? @updatedAt
@ -204,6 +204,7 @@ model Files {
document_uid String @db.VarChar(255)
file_path String @unique @db.VarChar(255)
file_name String @db.VarChar(255)
archived_at DateTime?
key String? @db.VarChar(255)
created_at DateTime? @default(now())
updated_at DateTime? @updatedAt

View File

@ -429,6 +429,7 @@ import {
file_name: "fileName1",
file_path: "https://www.google1.com",
key: '',
archived_at: null,
created_at: new Date(),
updated_at: new Date(),
},
@ -438,6 +439,7 @@ import {
file_name: "fileName2",
file_path: "https://www.google2.com",
key: '',
archived_at: null,
created_at: new Date(),
updated_at: new Date(),
},

View File

@ -66,7 +66,8 @@ export default class FilesRepository extends BaseRepository {
uid: uid,
},
data: {
key: null
key: null,
archived_at: new Date(Date.now())
}
});
}