better lol
This commit is contained in:
parent
45bd7c72c1
commit
61a5ad7257
@ -1,8 +1,4 @@
|
|||||||
create schema if not exists wynn;
|
create table if not exists wynn_guild_members (
|
||||||
create schema if not exists minecraft;
|
|
||||||
create schema if not exists discord;
|
|
||||||
|
|
||||||
create table if not exists wynn.guild_members (
|
|
||||||
guild_id UUID not null,
|
guild_id UUID not null,
|
||||||
member_id UUID not null,
|
member_id UUID not null,
|
||||||
rank text not null,
|
rank text not null,
|
||||||
@ -11,7 +7,7 @@ create table if not exists wynn.guild_members (
|
|||||||
primary key (guild_id, member_id),
|
primary key (guild_id, member_id),
|
||||||
unique(member_id)
|
unique(member_id)
|
||||||
);
|
);
|
||||||
create table if not exists wynn.guild_info (
|
create table if not exists wynn_guild_info (
|
||||||
uid UUID not null,
|
uid UUID not null,
|
||||||
name text not null,
|
name text not null,
|
||||||
prefix text not null,
|
prefix text not null,
|
||||||
@ -24,22 +20,22 @@ create table if not exists wynn.guild_info (
|
|||||||
primary key (uid)
|
primary key (uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
create index if not exists guild_info_xp on wynn.guild_info (xp);
|
create index if not exists wynn_guild_info_xp on wynn_guild_info (xp);
|
||||||
|
|
||||||
create table if not exists wynn.guild_season_results (
|
create table if not exists wynn_guild_season_results (
|
||||||
guild_id UUID not null,
|
guild_id UUID not null,
|
||||||
season text not null,
|
season text not null,
|
||||||
rating bigint not null,
|
rating bigint not null,
|
||||||
territories bigint not null,
|
territories bigint not null,
|
||||||
primary key (guild_id, season)
|
primary key (guild_id, season)
|
||||||
);
|
);
|
||||||
create table if not exists minecraft.user (
|
create table if not exists minecraft_user (
|
||||||
uid UUID not null,
|
uid UUID not null,
|
||||||
name text not null,
|
name text not null,
|
||||||
server text,
|
server text,
|
||||||
primary key (uid)
|
primary key (uid)
|
||||||
);
|
);
|
||||||
create table if not exists discord.guild_setting(
|
create table if not exists discord_guild_setting(
|
||||||
discord_guild text not null,
|
discord_guild text not null,
|
||||||
name text not null,
|
name text not null,
|
||||||
value jsonb not null,
|
value jsonb not null,
|
||||||
@ -54,6 +50,4 @@ drop table if exists wynn_guild_season_results;
|
|||||||
drop table if exists minecraft_user;
|
drop table if exists minecraft_user;
|
||||||
drop table if exists discord_guild_setting;
|
drop table if exists discord_guild_setting;
|
||||||
|
|
||||||
drop schema if exists wynn cascade;
|
|
||||||
drop schema if exists minecraft cascade;
|
|
||||||
drop schema if exists discord cascade;
|
|
||||||
|
60
migrations/002_fix.sql
Normal file
60
migrations/002_fix.sql
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
-- Write your migrate up statements here
|
||||||
|
create schema if not exists wynn;
|
||||||
|
create schema if not exists minecraft;
|
||||||
|
create schema if not exists discord;
|
||||||
|
|
||||||
|
drop table if exists wynn_guild_members;
|
||||||
|
drop table if exists wynn_guild_info;
|
||||||
|
drop table if exists wynn_guild_season_results;
|
||||||
|
drop table if exists minecraft_user;
|
||||||
|
drop table if exists discord_guild_setting;
|
||||||
|
|
||||||
|
create table if not exists wynn.guild_members (
|
||||||
|
guild_id UUID not null,
|
||||||
|
member_id UUID not null,
|
||||||
|
rank text not null,
|
||||||
|
joined_at timestamptz not null,
|
||||||
|
contributed bigint not null,
|
||||||
|
primary key (guild_id, member_id),
|
||||||
|
unique(member_id)
|
||||||
|
);
|
||||||
|
create table if not exists wynn.guild_info (
|
||||||
|
uid UUID not null,
|
||||||
|
name text not null,
|
||||||
|
prefix text not null,
|
||||||
|
xp bigint not null default 0,
|
||||||
|
level bigint,
|
||||||
|
xp_percent bigint,
|
||||||
|
territories bigint,
|
||||||
|
wars bigint,
|
||||||
|
created timestamptz,
|
||||||
|
primary key (uid)
|
||||||
|
);
|
||||||
|
|
||||||
|
create index if not exists guild_info_xp on wynn.guild_info (xp);
|
||||||
|
|
||||||
|
create table if not exists wynn.guild_season_results (
|
||||||
|
guild_id UUID not null,
|
||||||
|
season text not null,
|
||||||
|
rating bigint not null,
|
||||||
|
territories bigint not null,
|
||||||
|
primary key (guild_id, season)
|
||||||
|
);
|
||||||
|
create table if not exists minecraft.user (
|
||||||
|
uid UUID not null,
|
||||||
|
name text not null,
|
||||||
|
server text,
|
||||||
|
primary key (uid)
|
||||||
|
);
|
||||||
|
create table if not exists discord.guild_setting(
|
||||||
|
discord_guild text not null,
|
||||||
|
name text not null,
|
||||||
|
value jsonb not null,
|
||||||
|
primary key (discord_guild, name)
|
||||||
|
);
|
||||||
|
|
||||||
|
---- create above / drop below ----
|
||||||
|
|
||||||
|
drop schema if exists wynn cascade;
|
||||||
|
drop schema if exists minecraft cascade;
|
||||||
|
drop schema if exists discord cascade;
|
Loading…
Reference in New Issue
Block a user