· 6 years ago · Jan 03, 2020, 04:58 PM
1CREATE TYPE IslandType AS ENUM ('SKYBLOCK', 'GUILD');
2CREATE TABLE IF NOT EXISTS ISLANDS
3(
4 id serial not null,
5 created_date timestamp default current_timestamp,
6 spawn varchar not null,
7 type IslandType not null,
8 primary key (id)
9);
10
11
12CREATE TABLE IF NOT EXISTS SKYBLOCK_ISLANDS
13(
14 island_id int not null references ISLANDS (id),
15 x int not null,
16 z int not null,
17 owner UUID not null,
18 points int default 0,
19 extend_level int default 0,
20 primary key (island_id),
21 unique (owner),
22 unique (x, z)
23);
24
25CREATE TABLE IF NOT EXISTS GUILD_ISLANDS
26(
27 island_id int not null references ISLANDS (id),
28 owner int not null,
29 protection timestamp,
30 cuboid varchar not null,
31 primary key (island_id)
32);
33
34CREATE TYPE IslandMemberType AS ENUM ('ISLANDER', 'GUILD');
35CREATE TABLE IF NOT EXISTS ISLAND_MEMBERS
36(
37 island_id int not null references ISLANDS (id),
38 id varchar not null,
39 member_type IslandMemberType not null,
40 primary key (island_id, id, member_type)
41);