summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-12-02 14:14:34 +0100
committerDaniel Weipert <code@drogueronin.de>2023-12-02 14:14:34 +0100
commite5a243a52b910e35b10b26c06aa8978356b86769 (patch)
tree74ddb82add2f3ea200e9fd11cfedb6c0cace09be /bin
parentfa9096c0ab521aae45cab6c48a54290d14a221b9 (diff)
login and events
Diffstat (limited to 'bin')
-rw-r--r--bin/db.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/db.php b/bin/db.php
index 7f3f344..84cb85c 100644
--- a/bin/db.php
+++ b/bin/db.php
@@ -115,6 +115,10 @@ DB::query(<<<SQL
constraint "relation_event"
foreign key ("event_id") references events("id") on delete cascade,
+ "village_id" bigint not null,
+ constraint "relation_village"
+ foreign key ("village_id") references villages("id") on delete cascade,
+
"type" character varying(255) not null,
"created_at" timestamp(0) not null default current_timestamp,
@@ -130,6 +134,10 @@ DB::query(<<<SQL
constraint "relation_event"
foreign key ("event_id") references events("id") on delete cascade,
+ "village_id" bigint not null,
+ constraint "relation_village"
+ foreign key ("village_id") references villages("id") on delete cascade,
+
"amount" bigint not null,
"type" character varying(255) not null,
@@ -203,6 +211,23 @@ DB::query(<<<SQL
SQL);
DB::query(<<<SQL
+ create table if not exists "user_villages" (
+ "id" bigserial primary key,
+
+ "user_id" bigint not null,
+ constraint "relation_user"
+ foreign key ("user_id") references users("id") on delete cascade,
+
+ "village_id" bigint not null,
+ constraint "relation_village"
+ foreign key ("village_id") references villages("id") on delete cascade,
+
+ "created_at" timestamp(0) not null default current_timestamp,
+ "updated_at" timestamp(0) not null default current_timestamp
+ );
+SQL);
+
+DB::query(<<<SQL
create table if not exists "system" (
"key" character varying(255) primary key,
"value" jsonb