fix(auth): add account issuer migration
This commit is contained in:
+2
-4
@@ -62,6 +62,7 @@ export const accounts = pgTable(
|
|||||||
"account",
|
"account",
|
||||||
{
|
{
|
||||||
id: text("id").primaryKey(),
|
id: text("id").primaryKey(),
|
||||||
|
issuer: text("issuer").notNull(),
|
||||||
accountId: text("account_id").notNull(),
|
accountId: text("account_id").notNull(),
|
||||||
providerId: text("provider_id").notNull(),
|
providerId: text("provider_id").notNull(),
|
||||||
userId: text("user_id")
|
userId: text("user_id")
|
||||||
@@ -81,10 +82,7 @@ export const accounts = pgTable(
|
|||||||
...timestamps,
|
...timestamps,
|
||||||
},
|
},
|
||||||
(table) => [
|
(table) => [
|
||||||
uniqueIndex("account_provider_unique").on(
|
uniqueIndex("account_issuer_unique").on(table.issuer, table.accountId),
|
||||||
table.providerId,
|
|
||||||
table.accountId,
|
|
||||||
),
|
|
||||||
index("account_user_id_idx").on(table.userId),
|
index("account_user_id_idx").on(table.userId),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
DROP INDEX "account_provider_unique";--> statement-breakpoint
|
||||||
|
ALTER TABLE "account" ADD COLUMN "issuer" text NOT NULL;--> statement-breakpoint
|
||||||
|
CREATE UNIQUE INDEX "account_issuer_unique" ON "account" USING btree ("issuer","account_id");
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,13 @@
|
|||||||
"when": 1787932993638,
|
"when": 1787932993638,
|
||||||
"tag": "0000_free_lord_tyger",
|
"tag": "0000_free_lord_tyger",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 1,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1787989072634,
|
||||||
|
"tag": "0001_lumpy_marauders",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user