diff --git a/.ameba.yml b/.ameba.yml new file mode 100644 index 0000000..cf6a23c --- /dev/null +++ b/.ameba.yml @@ -0,0 +1,4 @@ +Lint/NotNil: + Enabled: false +Style/QueryBoolMethods: + Enabled: false \ No newline at end of file diff --git a/shard.override.yml b/shard.override.yml index 78cfdbd..d0638b7 100644 --- a/shard.override.yml +++ b/shard.override.yml @@ -5,7 +5,3 @@ dependencies: CrystalEmail: github: place-labs/CrystalEmail branch: master - - placeos-models: - github: placeos/models - branch: refactor/pg-migration \ No newline at end of file diff --git a/shard.yml b/shard.yml index ff97021..c19ce6f 100644 --- a/shard.yml +++ b/shard.yml @@ -13,7 +13,7 @@ dependencies: placeos-models: github: placeos/models - version: ">= 6.0" + version: ">= 9.0" promise: github: spider-gazelle/promise diff --git a/spec/migration/db/migrations/20221103182025_add_zone_table.sql b/spec/migration/db/migrations/20221103182025_add_zone_table.sql index 87b739d..e7faa2c 100644 --- a/spec/migration/db/migrations/20221103182025_add_zone_table.sql +++ b/spec/migration/db/migrations/20221103182025_add_zone_table.sql @@ -15,7 +15,9 @@ CREATE TABLE IF NOT EXISTS "zone"( count INTEGER NOT NULL, capacity INTEGER NOT NULL, map_id TEXT, + timezone TEXT, triggers TEXT[] NOT NULL, + images TEXT[] NOT NULL, parent_id TEXT, id TEXT NOT NULL PRIMARY KEY ); diff --git a/spec/migration/db/migrations/20221103182036_add_sys_table.sql b/spec/migration/db/migrations/20221103182036_add_sys_table.sql index deebaf7..614d742 100644 --- a/spec/migration/db/migrations/20221103182036_add_sys_table.sql +++ b/spec/migration/db/migrations/20221103182036_add_sys_table.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS "sys"( name TEXT NOT NULL, description TEXT NOT NULL, features TEXT[] NOT NULL, - email JSONB, + email TEXT, bookable BOOLEAN NOT NULL, display_name TEXT, code TEXT, diff --git a/spec/migration/db/migrations/20221103182052_add_user_table.sql b/spec/migration/db/migrations/20221103182052_add_user_table.sql index c2cf5db..aacf0bd 100644 --- a/spec/migration/db/migrations/20221103182052_add_user_table.sql +++ b/spec/migration/db/migrations/20221103182052_add_user_table.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS "user"( updated_at TIMESTAMPTZ NOT NULL, name TEXT NOT NULL, nickname TEXT NOT NULL, - email JSONB NOT NULL, + email TEXT NOT NULL, phone TEXT NOT NULL, country TEXT NOT NULL, image TEXT NOT NULL, diff --git a/spec/migration/db/migrations/20230224115858_add_sys_booking_feat.sql b/spec/migration/db/migrations/20230224115858_add_sys_booking_feat.sql new file mode 100644 index 0000000..f000b56 --- /dev/null +++ b/spec/migration/db/migrations/20230224115858_add_sys_booking_feat.sql @@ -0,0 +1,9 @@ +-- +micrate Up +-- SQL in section 'Up' is executed when this migration is applied + +ALTER TABLE "sys" ADD COLUMN public BOOLEAN NOT NULL DEFAULT false; + +-- +micrate Down +-- SQL section 'Down' is executed when this migration is rolled back + +ALTER TABLE "sys" DROP COLUMN public; diff --git a/spec/migration/db/migrations/20230314100503_alter_user_table.sql b/spec/migration/db/migrations/20230314100503_alter_user_table.sql new file mode 100644 index 0000000..5477adc --- /dev/null +++ b/spec/migration/db/migrations/20230314100503_alter_user_table.sql @@ -0,0 +1,18 @@ +-- +micrate Up +-- SQL in section 'Up' is executed when this migration is applied + +alter table "user" alter COLUMN nickname drop NOT NULL; +alter table "user" alter COLUMN phone drop NOT NULL; +alter table "user" alter COLUMN country drop NOT NULL; +alter table "user" alter COLUMN image drop NOT NULL; +alter table "user" alter COLUMN ui_theme drop NOT NULL; +alter table "user" alter COLUMN misc drop NOT NULL; + +-- +micrate Down +-- SQL section 'Down' is executed when this migration is rolled back +alter table "user" alter COLUMN nickname set NOT NULL; +alter table "user" alter COLUMN phone set NOT NULL; +alter table "user" alter COLUMN country set NOT NULL; +alter table "user" alter COLUMN image set NOT NULL; +alter table "user" alter COLUMN ui_theme set NOT NULL; +alter table "user" alter COLUMN misc set NOT NULL; \ No newline at end of file