This commit is contained in:
@@ -659,10 +659,32 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
||||
+ "responsetime INTERVAL NOT NULL, contractratesonly BOOL NOT NULL, partsoverride DECIMAL(5,5) NOT NULL, partsoverridetype INTEGER NOT NULL, "
|
||||
+ "serviceratesoverride DECIMAL(5,5) NOT NULL, serviceratesoverridetype INTEGER NOT NULL, travelratesoverride DECIMAL(5,5) NOT NULL, travelratesoverridetype INTEGER NOT NULL, "
|
||||
+"alertnotes text "
|
||||
+ "alertnotes text "
|
||||
+ ")");
|
||||
await ExecQueryAsync("ALTER TABLE acustomer ADD column contractid BIGINT NULL REFERENCES acontract");
|
||||
|
||||
//CONTRACTSERVICERATE
|
||||
await ExecQueryAsync("CREATE TABLE acontractservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||
+ "servicerateid BIGINT NOT NULL REFERENCES aservicerate ON DELETE CASCADE"
|
||||
+ ")");
|
||||
|
||||
//CONTRACTTRAVELERATE
|
||||
await ExecQueryAsync("CREATE TABLE acontracttravelrate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||
+ "travelrateid BIGINT NOT NULL REFERENCES atravelrate ON DELETE CASCADE"
|
||||
+ ")");
|
||||
|
||||
//CONTRACTPARTOVERRIDE
|
||||
await ExecQueryAsync("CREATE TABLE acontractpartoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||
+ " override DECIMAL(5,5) NOT NULL, overridetype INTEGER NOT NULL, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
//CONTRACTSERVICERATEOVERRIDE
|
||||
await ExecQueryAsync("CREATE TABLE acontractservicerateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||
+ " override DECIMAL(5,5) NOT NULL, overridetype INTEGER NOT NULL, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
//CONTRACTTRAVELRATEOVERRIDE
|
||||
await ExecQueryAsync("CREATE TABLE acontracttravelrateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||
+ " override DECIMAL(5,5) NOT NULL, overridetype INTEGER NOT NULL, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
|
||||
//HEADOFFICE
|
||||
await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||
|
||||
Reference in New Issue
Block a user