initial commit

This commit is contained in:
Morten V. Christiansen 2026-02-03 13:16:12 -05:00
commit b8bec4fe7c
4 changed files with 48 additions and 0 deletions

BIN
.create_tables.sql.swp Normal file

Binary file not shown.

30
create_tables.sql Normal file
View File

@ -0,0 +1,30 @@
drop table entity;
create table entity(
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
creation_ts TIMESTAMPTZ NOT NULL DEFAULT now(),
name varchar(100) NOT NULL,
group_p BOOLEAN NOT NULL,
geo_offset BIGINT,
--private_key VARCHAR(300) NOT NULL,
public_key VARCHAR(300) NOT NULL,
expiration DATE
);
drop table group_member;
create table group_member(
group_id INT,
person_id INT,
role VARCHAR(10),
PRIMARY KEY (group_id,person_id)
);
drop table property;
create table property(
id INT NOT NULL,
property_name VARCHAR(100)
);

Binary file not shown.

18
tests/create_testdata.sql Normal file
View File

@ -0,0 +1,18 @@
truncate table entity;
truncate table group_member;
truncate table property;
insert into entity (name,group_p,geo_offset,public_key)
values
('Svend',false,2355,'35AB456' ),
('Knud',false,4442,'36546AA'),
('Konger',true,3456, '87432CA');
insert into group_member(group_id,person_id)
values
(3,1);
insert into property(id,property_name)
values
(2,'aaa');