summaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20230829204517_create_plant_table.down.sql2
-rw-r--r--migrations/20230829204517_create_plant_table.up.sql8
-rw-r--r--migrations/20230829205506_create_stead_table.down.sql0
-rw-r--r--migrations/20230829205506_create_stead_table.up.sql12
4 files changed, 22 insertions, 0 deletions
diff --git a/migrations/20230829204517_create_plant_table.down.sql b/migrations/20230829204517_create_plant_table.down.sql
new file mode 100644
index 0000000..ab89f59
--- /dev/null
+++ b/migrations/20230829204517_create_plant_table.down.sql
@@ -0,0 +1,2 @@
+DROP TABLE Plant;
+DROP TYPE plant_kind;
diff --git a/migrations/20230829204517_create_plant_table.up.sql b/migrations/20230829204517_create_plant_table.up.sql
new file mode 100644
index 0000000..0302a0d
--- /dev/null
+++ b/migrations/20230829204517_create_plant_table.up.sql
@@ -0,0 +1,8 @@
+CREATE TYPE plant_kind AS ENUM('bbc', 'hvv', 'cyl', 'dirt');
+CREATE TABLE Plant (
+ id SERIAL PRIMARY KEY,
+ kind plant_kind NOT NULL DEFAULT 'dirt',
+ xp INTEGER NOT NULL DEFAULT 0,
+ xp_multiplier FLOAT NOT NULL DEFAULT 1,
+ next_yield TIMESTAMP
+);
diff --git a/migrations/20230829205506_create_stead_table.down.sql b/migrations/20230829205506_create_stead_table.down.sql
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/migrations/20230829205506_create_stead_table.down.sql
diff --git a/migrations/20230829205506_create_stead_table.up.sql b/migrations/20230829205506_create_stead_table.up.sql
new file mode 100644
index 0000000..55f3ccc
--- /dev/null
+++ b/migrations/20230829205506_create_stead_table.up.sql
@@ -0,0 +1,12 @@
+CREATE TABLE Stead (
+ id SERIAL PRIMARY KEY,
+ username TEXT NOT NULL UNIQUE,
+ password TEXT NOT NULL,
+ inventory JSONB,
+ ephemeral_statuses TEXT[]
+);
+
+CREATE TABLE stead_plant (
+ stead INTEGER references stead(id),
+ plant INTEGER references plant(id)
+);