File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
libs/microorm-database/src/lib/migrations Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 512512 "unsigned" : false ,
513513 "autoincrement" : false ,
514514 "primary" : false ,
515- "nullable" : false ,
515+ "nullable" : true ,
516516 "mappedType" : " integer"
517517 }
518518 },
542542 " id"
543543 ],
544544 "referencedTableName" : " public.users" ,
545+ "deleteRule" : " set null" ,
545546 "updateRule" : " cascade"
546547 }
547548 },
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export class Migration20250123130345_CreateUsersCommentsRelations extends Migrat
44
55 override async up ( ) : Promise < void > {
66 this . addSql ( `alter table "comments" add column "created_by" int;` ) ;
7- this . addSql ( `alter table "comments" add constraint "comments_created_by_foreign" foreign key ("created_by") references "users" ("id") on update cascade;` ) ;
7+ this . addSql ( `alter table "comments" add constraint "comments_created_by_foreign" foreign key ("created_by") references "users" ("id") on update cascade on delete set null ;` ) ;
88 }
99
1010 override async down ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments