File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
migrations/20260130181211_set_uid_for_ids Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ Warnings:
3+
4+ - The primary key for the `IntegrationStatus` table will be changed. If it partially fails, the table could be left without primary key constraint.
5+ - The primary key for the `Webcam` table will be changed. If it partially fails, the table could be left without primary key constraint.
6+
7+ */
8+ -- DropForeignKey
9+ ALTER TABLE " Webcam" DROP CONSTRAINT " Webcam_integrationStatusId_fkey" ;
10+
11+ -- AlterTable
12+ ALTER TABLE " IntegrationStatus" DROP CONSTRAINT " IntegrationStatus_pkey" ,
13+ ALTER COLUMN " id" DROP DEFAULT,
14+ ALTER COLUMN " id" SET DATA TYPE TEXT ,
15+ ADD CONSTRAINT " IntegrationStatus_pkey" PRIMARY KEY (" id" );
16+ DROP SEQUENCE " IntegrationStatus_id_seq" ;
17+
18+ -- AlterTable
19+ ALTER TABLE " Webcam" DROP CONSTRAINT " Webcam_pkey" ,
20+ ALTER COLUMN " id" DROP DEFAULT,
21+ ALTER COLUMN " id" SET DATA TYPE TEXT ,
22+ ALTER COLUMN " integrationStatusId" SET DATA TYPE TEXT ,
23+ ADD CONSTRAINT " Webcam_pkey" PRIMARY KEY (" id" );
24+ DROP SEQUENCE " Webcam_id_seq" ;
25+
26+ -- AddForeignKey
27+ ALTER TABLE " Webcam" ADD CONSTRAINT " Webcam_integrationStatusId_fkey" FOREIGN KEY (" integrationStatusId" ) REFERENCES " IntegrationStatus" (" id" ) ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change @@ -14,20 +14,20 @@ datasource db {
1414}
1515
1616model Webcam {
17- id Int @id @default (autoincrement () )
17+ id String @id @default (cuid () )
1818 name String @unique
1919 angleOfView Float
2020 elevation Int ?
2121 latitude Float
2222 longitude Float
2323 refreshSeconds Int ?
2424 comments String ?
25- integrationStatusId Int
25+ integrationStatusId String
2626 integrationStatus IntegrationStatus @relation (fields : [integrationStatusId ] , references : [id ] )
2727}
2828
2929model IntegrationStatus {
30- id Int @id @default (autoincrement () )
30+ id String @id @default (cuid () )
3131 code String @unique
3232 labelKey String
3333
You can’t perform that action at this time.
0 commit comments