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
31
server/setup/scriptsSqlite/1.4.0.ts
Normal file
31
server/setup/scriptsSqlite/1.4.0.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { db } from "../../db/sqlite";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
const version = "1.4.0";
|
||||
|
||||
export default async function migration() {
|
||||
console.log(`Running setup script ${version}...`);
|
||||
|
||||
try {
|
||||
db.transaction((trx) => {
|
||||
trx.run(sql`CREATE TABLE 'passkey' (
|
||||
'credentialId' text PRIMARY KEY NOT NULL,
|
||||
'userId' text NOT NULL,
|
||||
'publicKey' text NOT NULL,
|
||||
'signCount' integer NOT NULL,
|
||||
'transports' text,
|
||||
'name' text,
|
||||
'lastUsed' text NOT NULL,
|
||||
'dateCreated' text NOT NULL,
|
||||
FOREIGN KEY ('userId') REFERENCES 'user'('id') ON DELETE CASCADE
|
||||
);`);
|
||||
});
|
||||
|
||||
console.log(`Migrated database schema`);
|
||||
} catch (e) {
|
||||
console.log("Unable to migrate database schema");
|
||||
throw e;
|
||||
}
|
||||
|
||||
console.log(`${version} migration complete`);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue