mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
refactor(database): ♻️ Make user avatar and header into a Media instead of plaintext
This commit is contained in:
parent
bc961b70bb
commit
ba431e2b11
11 changed files with 2480 additions and 89 deletions
6
drizzle/migrations/0045_polite_mikhail_rasputin.sql
Normal file
6
drizzle/migrations/0045_polite_mikhail_rasputin.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE "Users" ADD COLUMN "avatarId" uuid;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD COLUMN "headerId" uuid;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD CONSTRAINT "Users_avatarId_Medias_id_fk" FOREIGN KEY ("avatarId") REFERENCES "public"."Medias"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD CONSTRAINT "Users_headerId_Medias_id_fk" FOREIGN KEY ("headerId") REFERENCES "public"."Medias"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint
|
||||
ALTER TABLE "Users" DROP COLUMN "avatar";--> statement-breakpoint
|
||||
ALTER TABLE "Users" DROP COLUMN "header";
|
||||
2349
drizzle/migrations/meta/0045_snapshot.json
Normal file
2349
drizzle/migrations/meta/0045_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -316,6 +316,13 @@
|
|||
"when": 1738082427051,
|
||||
"tag": "0044_quiet_jasper_sitwell",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 45,
|
||||
"version": "7",
|
||||
"when": 1738087527661,
|
||||
"tag": "0045_polite_mikhail_rasputin",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue