u
This commit is contained in:
@@ -374,6 +374,20 @@ BEGIN
|
||||
);
|
||||
END
|
||||
`;
|
||||
export const INIT_COMPANYHISTORY = `
|
||||
IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'companyhistory')
|
||||
BEGIN
|
||||
CREATE TABLE companyhistory (
|
||||
id INT IDENTITY(1,1) PRIMARY KEY,
|
||||
company_id INT NOT NULL,
|
||||
companyuser_id INT NULL,
|
||||
[date] DATETIME2 NOT NULL CONSTRAINT DF_companyhistory_date DEFAULT SYSUTCDATETIME(),
|
||||
[text] NVARCHAR(MAX) NOT NULL,
|
||||
CONSTRAINT FK_companyhistory_company FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE,
|
||||
CONSTRAINT FK_companyhistory_companyuser FOREIGN KEY (companyuser_id) REFERENCES companyuser(id) ON DELETE SET NULL
|
||||
);
|
||||
END
|
||||
`;
|
||||
|
||||
export const INIT_ARTICLETOMBSTONE = `
|
||||
IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'articletombstone')
|
||||
@@ -1147,6 +1161,7 @@ export const SCHEMA_SCRIPTS = [
|
||||
INIT_ARTICLEHISTORY,
|
||||
INIT_ARTICLETOMBSTONE,
|
||||
INIT_ENTITYHISTORY,
|
||||
INIT_COMPANYHISTORY,
|
||||
INIT_SYNCPOS,
|
||||
INIT_COMPANYSETTING,
|
||||
INIT_POSTERMINAL,
|
||||
|
||||
Reference in New Issue
Block a user