Rename LNbits primary key column from 'int' to 'id' (#1321)
* Rename LNbits primary key column from 'int' to 'id' * fix migration --------- Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: k00b <k00b@stacker.news>
This commit is contained in:
parent
789d7626f7
commit
67d71ef0c8
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The primary key for the `WalletLNbits` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||
- You are about to drop the column `int` on the `WalletLNbits` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "WalletLNbits" RENAME COLUMN "int" TO "id";
|
||||
|
||||
UPDATE "Wallet"
|
||||
SET wallet = to_jsonb("WalletLNbits")
|
||||
FROM "WalletLNbits"
|
||||
WHERE "Wallet".id = "WalletLNbits"."walletId";
|
@ -246,7 +246,7 @@ model WalletCLN {
|
||||
}
|
||||
|
||||
model WalletLNbits {
|
||||
int Int @id @default(autoincrement())
|
||||
id Int @id @default(autoincrement())
|
||||
walletId Int @unique
|
||||
wallet Wallet @relation(fields: [walletId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
Loading…
x
Reference in New Issue
Block a user