Add company-scoped delivery store on manifest

This commit is contained in:
seb
2026-08-06 05:32:48 +02:00
parent 4f46967f28
commit 0b7e40ac9c
14 changed files with 2133 additions and 1375 deletions

View File

@@ -468,10 +468,12 @@ IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'manifest')
BEGIN
CREATE TABLE manifest (
id INT IDENTITY(1,1) PRIMARY KEY,
company_id INT NOT NULL,
[number] NVARCHAR(100) NOT NULL,
[type] NVARCHAR(100) NOT NULL,
entity_id INT NULL,
[date] DATETIME2 NOT NULL CONSTRAINT DF_manifest_date DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_manifest_company FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE NO ACTION,
CONSTRAINT FK_manifest_entity FOREIGN KEY (entity_id) REFERENCES entity(id) ON DELETE SET NULL
);
END