mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 14:39:29 +02:00
refactor: rename passkeyChallenge to webauthnChallenge
- Renamed table for consistency with webauthnCredentials - Created migration script 1.8.1.ts for table rename - Updated schema definitions in SQLite and PostgreSQL - Maintains WebAuthn standard naming convention
This commit is contained in:
parent
baee745d3c
commit
db76558944
19 changed files with 1735 additions and 387 deletions
27
server/setup/scriptsSqlite/1.8.1.ts
Normal file
27
server/setup/scriptsSqlite/1.8.1.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { db } from "@server/db";
|
||||
|
||||
export default async function migrate() {
|
||||
try {
|
||||
console.log("Starting table rename migration...");
|
||||
|
||||
// Rename the table
|
||||
await db.run(`
|
||||
ALTER TABLE passkeyChallenge RENAME TO webauthnChallenge;
|
||||
`);
|
||||
console.log("Successfully renamed table");
|
||||
|
||||
// Rename the index
|
||||
await db.run(`
|
||||
DROP INDEX IF EXISTS idx_passkeyChallenge_expiresAt;
|
||||
CREATE INDEX IF NOT EXISTS idx_webauthnChallenge_expiresAt ON webauthnChallenge(expiresAt);
|
||||
`);
|
||||
console.log("Successfully updated index");
|
||||
|
||||
console.log(`Renamed passkeyChallenge table to webauthnChallenge`);
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
console.error("Unable to rename passkeyChallenge table:", error);
|
||||
console.error("Error details:", error.message);
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue