feat: adust sql scripts

This commit is contained in:
dancingCycle 2023-03-15 14:52:42 +01:00
parent 3851946f4b
commit 1f5380460f
2 changed files with 27 additions and 0 deletions

View File

@ -4,3 +4,16 @@ DROP TABLE IF EXISTS entities;
CREATE TABLE IF NOT EXISTS entities(
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL);
---
DELETE FROM entities;
INSERT INTO entities (name)
VALUES
('AfB gemeinnützige GmbH'),
('Green Planet Energy eG'),
('Hostsharing eG'),
('kleiner Heide Laden'),
('Regionale Energie- und KlimaschutzAgentur e. V.'),
('Software Ingenieur Begerad'),
('WEtell GmbH'),
('WTF Kooperative eG')
RETURNING *;

View File

@ -9,3 +9,17 @@ CREATE TABLE IF NOT EXISTS relations(
FOREIGN KEY(relation_role) REFERENCES relation_roles(id),
FOREIGN KEY(to_entity) REFERENCES entities(id),
FOREIGN KEY(from_entity) REFERENCES entities(id));
---
DELETE FROM relations;
INSERT INTO relations (relation_role,from_entity,to_entity)
VALUES
(1,6,1),
(1,6,2),
(1,6,3),
(1,6,4),
(1,6,5),
(1,6,7),
(1,6,8),
(1,5,6)
RETURNING *;