diff --git a/pgsql/graph/load_basic.sql b/pgsql/graph/load_basic.sql index d9aec35..d411858 100644 --- a/pgsql/graph/load_basic.sql +++ b/pgsql/graph/load_basic.sql @@ -2,7 +2,7 @@ -- load bootstrap and basic semantic steps -- basic concepts with fixed IDs -insert into steps (id, item, property, valtype, numval, strval) values +insert into steps (id, item, property, valtype, numval, textval) values (1, 1, 2, 3, 1, null), -- this: this is this (2, 1, 2, 3, 2, null), -- is: this is is (3, 1, 2, 3, 3, null), -- Class: this is Class @@ -11,7 +11,7 @@ insert into steps (id, item, property, valtype, numval, strval) values (6, 1, 2, 3, 6, null); -- name: this is name -- basic types and names -insert into steps (item, property, valtype, numval, strval) values +insert into steps (item, property, valtype, numval, textval) values (3, 4, 3, 3, null), -- Class type Class (5, 4, 3, 3, null), -- property type Class (4, 4, 3, 5, null), -- type type Property diff --git a/pgsql/graph/tables.sql b/pgsql/graph/tables.sql index 0b536d7..6bcfe81 100644 --- a/pgsql/graph/tables.sql +++ b/pgsql/graph/tables.sql @@ -6,18 +6,18 @@ create sequence steps_id_seq start with 11; create table steps ( id bigint not null primary key default nextval('steps_id_seq'), - item bigint not null, - property bigint not null references steps, + item bigint not null, --references steps, + property bigint not null, --references steps, valtype smallint not null check (valtype in (0, 1, 2, 3)), -- 0 = Nothing, 1 = Text, 2 = Number, 3 = Step numval bigint, -- null except for valtype 2 and 3 - strval text -- null except for valtype 1 + textval text -- null except for valtype 1 ); -- indexes -create index idx_ipv on steps USING btree (item, property, valtype, numval, strval); -create index idx_pv on steps using btree (property, valtype, numval, strval); +create index idx_ipv on steps USING btree (item, property, valtype, numval, textval); +create index idx_pv on steps using btree (property, valtype, numval, textval); -- optional, not used (values make only sense together with a property): --create index idx_vi on steps using btree (valtype, numval, strval, item);