diff options
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 |