u
This commit is contained in:
@@ -413,6 +413,14 @@ export class BetterSqlite3Provider extends BetterSqlite3Executor {
|
||||
`ALTER TABLE warehouse ADD COLUMN sort INTEGER NOT NULL DEFAULT 0`,
|
||||
);
|
||||
}
|
||||
|
||||
const posterminalCols = this.db.pragma('table_info("posterminal")').map((c) => c.name);
|
||||
if (posterminalCols.length > 0 && !posterminalCols.includes('paired_at')) {
|
||||
this.db.exec(`ALTER TABLE posterminal ADD COLUMN paired_at TEXT`);
|
||||
}
|
||||
if (posterminalCols.length > 0 && !posterminalCols.includes('clientserial')) {
|
||||
this.db.exec(`ALTER TABLE posterminal ADD COLUMN clientserial TEXT`);
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ const queries = translateQueries(source, 'posterminal');
|
||||
export const {
|
||||
CREATE, DELETE_BY_COMPANY_AND_ID, GET_BY_ID, LIST_BY_COMPANY,
|
||||
LIST_CATEGORY_IDS, POSTERMINAL_IDS_BY_COMPANY, SET_OFF, SET_OFF_ALL, UPDATE,
|
||||
FIND_BY_PAIRINGPIN, PAIR,
|
||||
} = queries;
|
||||
|
||||
export const SET_ON = `
|
||||
|
||||
@@ -533,6 +533,8 @@ CREATE TABLE IF NOT EXISTS posterminal (
|
||||
name TEXT NOT NULL,
|
||||
token TEXT,
|
||||
pairingpin TEXT NOT NULL,
|
||||
paired_at TEXT,
|
||||
clientserial TEXT,
|
||||
FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS UQ_posterminal_token
|
||||
|
||||
Reference in New Issue
Block a user