diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-12-02 14:14:34 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-12-02 14:14:34 +0100 |
commit | e5a243a52b910e35b10b26c06aa8978356b86769 (patch) | |
tree | 74ddb82add2f3ea200e9fd11cfedb6c0cace09be /bin/db.php | |
parent | fa9096c0ab521aae45cab6c48a54290d14a221b9 (diff) |
login and events
Diffstat (limited to 'bin/db.php')
-rw-r--r-- | bin/db.php | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 |