This commit is contained in:
seb
2026-10-22 14:39:45 +02:00
parent 9495ad51cc
commit e9b4ac5d79
31 changed files with 3405 additions and 3392 deletions

View File

@@ -392,20 +392,20 @@ BEGIN
END
`;
export const INIT_POSTERMINALTOMBSTONE = `
IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'posterminaltombstone')
export const INIT_POSTERMINALOBITUARY = `
IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'posterminalobituary')
BEGIN
CREATE TABLE posterminaltombstone (
CREATE TABLE posterminalobituary (
id INT IDENTITY(1,1) PRIMARY KEY,
posterminal_id INT NOT NULL,
entity_type NVARCHAR(50) NOT NULL,
entity_id INT NOT NULL,
created_at DATETIME2 NOT NULL CONSTRAINT DF_posterminaltombstone_created_at DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_posterminaltombstone_posterminal FOREIGN KEY (posterminal_id) REFERENCES posterminal(id) ON DELETE CASCADE
created_at DATETIME2 NOT NULL CONSTRAINT DF_posterminalobituary_created_at DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_posterminalobituary_posterminal FOREIGN KEY (posterminal_id) REFERENCES posterminal(id) ON DELETE CASCADE
);
CREATE INDEX IX_posterminaltombstone_posterminal_id
ON posterminaltombstone (posterminal_id, id);
CREATE INDEX IX_posterminalobituary_posterminal_id
ON posterminalobituary (posterminal_id, id);
END
`;
@@ -894,7 +894,7 @@ BEGIN
pairingpin NVARCHAR(50) NULL,
paired_at DATETIME2 NULL,
clientserial NVARCHAR(255) NULL,
maxknowntombstoneid INT NULL,
maxknownobituaryid INT NULL,
root_category_id INT NULL,
sync_root_articles BIT NOT NULL CONSTRAINT DF_posterminal_sync_root_articles DEFAULT 1,
lastseen_at DATETIME2 NULL,
@@ -1503,7 +1503,7 @@ export const SCHEMA_SCRIPTS = [
INIT_COMPANYSETTING,
INIT_POSTERMINAL,
INIT_POSTERMINALCATEGORY,
INIT_POSTERMINALTOMBSTONE,
INIT_POSTERMINALOBITUARY,
INIT_PRINTER,
INIT_LABELTEMPLATE,
INIT_FILE,