Skip to content

Commit 7a4832a

Browse files
committed
Drop VaultEntry table
1 parent 9961295 commit 7a4832a

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

prisma/migrations/20250411012334_vault_refactor/migration.sql

+5-1
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,8 @@ END;
201201
$$ LANGUAGE plpgsql;
202202

203203
SELECT migrate_wallet_vault();
204-
DROP FUNCTION migrate_wallet_vault();
204+
DROP FUNCTION migrate_wallet_vault();
205+
206+
ALTER TABLE "VaultEntry" DROP CONSTRAINT "VaultEntry_userId_fkey";
207+
ALTER TABLE "VaultEntry" DROP CONSTRAINT "VaultEntry_walletId_fkey";
208+
DROP TABLE "VaultEntry";

prisma/schema.prisma

-18
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ model User {
146146
oneDayReferrees OneDayReferral[] @relation("OneDayReferral_referrees")
147147
vaultKeyHash String @default("")
148148
walletsUpdatedAt DateTime?
149-
vaultEntries VaultEntry[] @relation("VaultEntries")
150149
proxyReceive Boolean @default(true)
151150
directReceive Boolean @default(true)
152151
DirectPaymentReceived DirectPayment[] @relation("DirectPaymentReceived")
@@ -243,7 +242,6 @@ model Wallet {
243242
walletLNC WalletLNC?
244243
walletWebLN WalletWebLN?
245244
246-
vaultEntries VaultEntry[] @relation("VaultEntries")
247245
withdrawals Withdrawl[]
248246
InvoiceForward InvoiceForward[]
249247
DirectPayment DirectPayment[]
@@ -270,22 +268,6 @@ model Vault {
270268
walletLNCLocalKey WalletLNC? @relation("lncLocalKey")
271269
}
272270

273-
model VaultEntry {
274-
id Int @id @default(autoincrement())
275-
key String @db.Text
276-
iv String @db.Text
277-
value String @db.Text
278-
userId Int
279-
walletId Int?
280-
user User @relation(fields: [userId], references: [id], onDelete: Cascade, name: "VaultEntries")
281-
wallet Wallet? @relation(fields: [walletId], references: [id], onDelete: Cascade, name: "VaultEntries")
282-
createdAt DateTime @default(now()) @map("created_at")
283-
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
284-
285-
@@unique([userId, key])
286-
@@index([walletId])
287-
}
288-
289271
model WalletLog {
290272
id Int @id @default(autoincrement())
291273
createdAt DateTime @default(now()) @map("created_at")

0 commit comments

Comments
 (0)