This commit is contained in:
seb
2026-09-30 09:48:01 +02:00
parent 9885c489f0
commit 280a45a11f
28 changed files with 539 additions and 16 deletions

View File

@@ -77,6 +77,7 @@ BEGIN
id INT IDENTITY(1,1) PRIMARY KEY,
parent_id INT NULL,
sort INT NOT NULL CONSTRAINT DF_category_sort DEFAULT 0,
updated_at DATETIME2 NOT NULL CONSTRAINT DF_category_updated_at DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_category_parent FOREIGN KEY (parent_id) REFERENCES category(id) ON DELETE NO ACTION
);
END
@@ -134,6 +135,7 @@ BEGIN
-- Nullable only for company-create chicken-egg (POS group first, then company, then SET).
-- Always set before commit; never left null for live rows.
company_id INT NULL,
updated_at DATETIME2 NOT NULL CONSTRAINT DF_customergroup_updated_at DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_customergroup_company FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE
);
END