This commit is contained in:
2021-03-26 15:04:03 +00:00
parent e33c94bf24
commit 0432bc3628
2 changed files with 46 additions and 13 deletions

View File

@@ -739,7 +739,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
//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)");
//WORKORDERITEM STATUS
await ExecQueryAsync("CREATE TABLE aworkorderitemstatus (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')");
@@ -761,15 +761,22 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
+ "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"
+ ")");
here
//WORKORDERITEM
await ExecQueryAsync("CREATE TABLE aworkorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), "
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, technotes TEXT, workorderitemstatusid BIGINT REFERENCES aworkorderitemstatus (id), "
+ " workorderitempriorityid BIGINT REFERENCES aworkorderitempriority (id), requestdate TIMESTAMP, warrantyservice BOOL NOT NULL"
+ ")");
//WORKORDERITEM EXPENSE
await ExecQueryAsync("CREATE TABLE aworkorderitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL"
+ ")");
//WORKORDERITEM LABOR
await ExecQueryAsync("CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
+ ""
+ ")");
await ExecQueryAsync("CREATE TABLE aworkorderitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");