This commit is contained in:
seb
2026-07-31 09:00:14 +02:00
parent 4f98082061
commit 99dd76075e
24 changed files with 1477 additions and 1175 deletions

View File

@@ -106,6 +106,7 @@ BEGIN
taxrate INT NULL,
reducedtaxrate INT NULL,
taxfreerate INT NULL,
poscustomergroup_id INT NULL,
CONSTRAINT UQ_company_name UNIQUE (name),
CONSTRAINT FK_company_root_category FOREIGN KEY (root_category_id) REFERENCES category(id) ON DELETE SET NULL,
CONSTRAINT FK_company_default_language FOREIGN KEY (default_language_id) REFERENCES language(id) ON DELETE SET NULL,
@@ -128,6 +129,17 @@ BEGIN
END
`;
export const INIT_COMPANY_POS_CUSTOMERGROUP_FK = `
IF NOT EXISTS (
SELECT 1 FROM sys.foreign_keys WHERE name = N'FK_company_poscustomergroup'
)
BEGIN
ALTER TABLE company
ADD CONSTRAINT FK_company_poscustomergroup
FOREIGN KEY (poscustomergroup_id) REFERENCES customergroup(id) ON DELETE NO ACTION;
END
`;
export const INIT_ENTITY = `
IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'entity')
BEGIN
@@ -516,6 +528,7 @@ export const SCHEMA_SCRIPTS = [
INIT_COMPANY,
INIT_GOOGLE_AUTH,
INIT_CUSTOMERGROUP,
INIT_COMPANY_POS_CUSTOMERGROUP_FK,
INIT_ENTITY,
INIT_UNIT,
INIT_UNITTEXT,