ekzyis 67d71ef0c8
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>
2024-08-21 10:49:48 -05:00

15 lines
470 B
SQL

/*
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";