rename strval to textval

This commit is contained in:
Helmut Merz 2021-02-16 16:12:38 +01:00
parent c127115381
commit 34938202c8
2 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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);