This commit is contained in:
2021-02-16 00:29:06 +00:00
parent 31a66de8a5
commit 81b5f31e1f
3 changed files with 27 additions and 4 deletions

View File

@@ -740,6 +740,11 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
"projectid BIGINT REFERENCES aproject, text1 TEXT, text2 TEXT " +
" )");
//PURCHASEORDERITEM
await ExecQueryAsync("CREATE TABLE apurchaseorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, purchaseorderid BIGINT NOT NULL REFERENCES apurchaseorder ON DELETE CASCADE, " +
"partid BIGINT NOT NULL REFERENCES apart ON DELETE CASCADE, quantity DECIMAL(19,4) NOT NULL default 1, " +
"CONSTRAINT unq_partassemblypart UNIQUE (partid, partassemblyid) " +//ensure no duplicate parts in the same assembly
")");
//UNITMODEL
await ExecQueryAsync("CREATE TABLE aunitmodel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NULL, active BOOL NOT NULL, " +