mirror of
https://github.com/djhackersdev/minime.git
synced 2026-04-25 08:06:45 -05:00
idz: Add initial team tables
This commit is contained in:
parent
f874f56816
commit
d1c3051a5e
|
|
@ -190,3 +190,54 @@ create table "idz"."unlocks" (
|
|||
"music" integer not null,
|
||||
"last_mileage_reward" integer not null
|
||||
);
|
||||
|
||||
create table "idz"."team" (
|
||||
"id" bigint primary key not null,
|
||||
"ext_id" integer not null,
|
||||
"name" text not null,
|
||||
"name_bg" smallint not null,
|
||||
"name_fx" smallint not null,
|
||||
"register_time" timestamp not null,
|
||||
constraint "team_uq" unique ("ext_id")
|
||||
);
|
||||
|
||||
create table "idz"."team" (
|
||||
"id" bigint primary key not null,
|
||||
"ext_id" integer not null,
|
||||
"name" text not null,
|
||||
"name_bg" smallint not null,
|
||||
"name_fx" smallint not null,
|
||||
"register_time" timestamp not null,
|
||||
constraint "team_uq" unique ("ext_id")
|
||||
);
|
||||
|
||||
create table "idz"."team_auto" (
|
||||
"id" bigint primary key not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"serial_no" smallint not null,
|
||||
"name_idx" smallint not null,
|
||||
constraint "team_auto_uq" unique ("serial_no", "name_idx")
|
||||
);
|
||||
|
||||
create table "idz"."team_member" (
|
||||
"id" bigint primary key not null
|
||||
references "idz"."profile"("id")
|
||||
on delete cascade,
|
||||
"team_id" bigint not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"join_time" timestamp not null,
|
||||
"leader" boolean not null
|
||||
);
|
||||
|
||||
create table "idz"."team_reservation" (
|
||||
"id" bigint primary key not null
|
||||
references "aime"."player"("id")
|
||||
on delete cascade,
|
||||
"team_id" bigint not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"join_time" timestamp not null,
|
||||
"leader" boolean not null
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
create table "meta" ("schemaver" integer not null);
|
||||
insert into "meta" values (2);
|
||||
insert into "meta" values (3);
|
||||
|
|
|
|||
42
schema/migrate/M0003-idz-add-team.sql
Normal file
42
schema/migrate/M0003-idz-add-team.sql
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
create table "idz"."team" (
|
||||
"id" bigint primary key not null,
|
||||
"ext_id" integer not null,
|
||||
"name" text not null,
|
||||
"name_bg" smallint not null,
|
||||
"name_fx" smallint not null,
|
||||
"register_time" timestamp not null,
|
||||
constraint "team_uq" unique ("ext_id")
|
||||
);
|
||||
|
||||
create table "idz"."team_auto" (
|
||||
"id" bigint primary key not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"serial_no" smallint not null,
|
||||
"name_idx" smallint not null,
|
||||
constraint "team_auto_uq" unique ("serial_no", "name_idx")
|
||||
);
|
||||
|
||||
create table "idz"."team_member" (
|
||||
"id" bigint primary key not null
|
||||
references "idz"."profile"("id")
|
||||
on delete cascade,
|
||||
"team_id" bigint not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"join_time" timestamp not null,
|
||||
"leader" boolean not null
|
||||
);
|
||||
|
||||
create table "idz"."team_reservation" (
|
||||
"id" bigint primary key not null
|
||||
references "aime"."player"("id")
|
||||
on delete cascade,
|
||||
"team_id" bigint not null
|
||||
references "idz"."team"("id")
|
||||
on delete cascade,
|
||||
"join_time" timestamp not null,
|
||||
"leader" boolean not null
|
||||
);
|
||||
|
||||
update "meta" set "schemaver" = 2;
|
||||
Loading…
Reference in New Issue
Block a user