Fix fk
This commit is contained in:
parent
c36095ffc5
commit
22b36f1259
1 changed files with 3 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ const runMigrations = () => {
|
|||
))
|
||||
.join(', ');
|
||||
|
||||
// Disable foreign key checks while rebuilding the users table.
|
||||
db.exec('PRAGMA foreign_keys = OFF');
|
||||
db.exec('BEGIN');
|
||||
db.exec('ALTER TABLE users RENAME TO users_old');
|
||||
db.exec(`
|
||||
|
|
@ -107,6 +109,7 @@ const runMigrations = () => {
|
|||
`);
|
||||
db.exec('DROP TABLE users_old');
|
||||
db.exec('COMMIT');
|
||||
db.exec('PRAGMA foreign_keys = ON');
|
||||
userTableInfo2 = db.prepare("PRAGMA table_info(users)").all() as { name: string }[];
|
||||
}
|
||||
if (didDropApiKeyColumns) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue