This commit is contained in:
@@ -736,6 +736,14 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║
|
||||
╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
//TASKGROUP
|
||||
await ExecQueryAsync("CREATE TABLE ataskgroup (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, notes TEXT)");
|
||||
|
||||
//TASK
|
||||
await ExecQueryAsync("CREATE TABLE ataskgroupitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, taskgroupid BIGINT NOT NULL REFERENCES ataskgroup ON DELETE CASCADE, "
|
||||
+ "displayorder INTEGER NOT NULL DEFAULT 0, name TEXT NOT NULL)");
|
||||
|
||||
//WORKORDER STATUS
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000', selectroles INTEGER NOT NULL, removeroles INTEGER NOT NULL, completed BOOL NOT NULL, locked BOOL NOT NULL)");
|
||||
@@ -775,7 +783,9 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//WORKORDERITEM LABOR
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMP, servicestopdate TIMESTAMP, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, servicebankid BIGINT REFERENCES aservicebank, taxcodesaleid BIGINT REFERENCES ataxcode"
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, servicebankid BIGINT REFERENCES aservicebank, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, baseprice DECIMAL(38,18) NOT NULL default 0, price DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "manualdiscountpct DECIMAL(8,5) NOT NULL default 0 "
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM LOAN
|
||||
@@ -804,17 +814,24 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
+ "estimatedquantity DECIMAL(19,5) NOT NULL default 0"
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM TASK
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemtask (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
||||
+ "displayorder INTEGER NOT NULL DEFAULT 0, task text NOT NULL, status INTEGER NOT NULL DEFAULT 1, completedbyuserid BIGINT REFERENCES auser, completeddate TIMESTAMP"
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM TRAVEL
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemtravel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
||||
+ "userid BIGINT REFERENCES auser, travelstartdate TIMESTAMP, travelstopdate TIMESTAMP, travelrateid BIGINT REFERENCES atravelrate, traveldetails text, "
|
||||
+ "travelratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, servicebankid BIGINT REFERENCES atravelbank, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, baseprice DECIMAL(38,18) NOT NULL default 0, price DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "manualdiscountpct DECIMAL(8,5) NOT NULL default 0 "
|
||||
+ ")");
|
||||
|
||||
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemunit (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
|
||||
|
||||
//POITEM LINK
|
||||
await ExecQueryAsync("ALTER TABLE apurchaseorderitem ADD column workorderitempartrequestid BIGINT REFERENCES aworkorderitempartrequest");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user