-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/phase-2' into dev
- Loading branch information
Showing
21 changed files
with
320 additions
and
12 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
hasura/metadata/databases/punkga-pg/tables/public_bookshelf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
hasura/metadata/databases/punkga-pg/tables/public_campaign.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
table: | ||
name: campaign | ||
schema: public | ||
array_relationships: | ||
- name: campaign_quests | ||
using: | ||
foreign_key_constraint_on: | ||
column: campaign_id | ||
table: | ||
name: quests | ||
schema: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
hasura/metadata/databases/punkga-pg/tables/public_quests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
table: | ||
name: quests | ||
schema: public | ||
object_relationships: | ||
- name: quests_campaign | ||
using: | ||
foreign_key_constraint_on: campaign_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1696925379713_create_table_public_quests/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."quests"; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1696925379713_create_table_public_quests/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE "public"."quests" ("id" serial NOT NULL, "name" text NOT NULL, "type" text NOT NULL, "condition" jsonb NOT NULL, "requirement" jsonb NOT NULL, "reward" jsonb NOT NULL, "status" text NOT NULL, PRIMARY KEY ("id") ); |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1696925499642_create_table_public_campaign/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."campaign"; |
17 changes: 17 additions & 0 deletions
17
hasura/migrations/punkga-pg/1696925499642_create_table_public_campaign/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE TABLE "public"."campaign" ("id" serial NOT NULL, "name" text NOT NULL, "start_date" timestamptz NOT NULL, "end_date" timestamptz NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") ); | ||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() | ||
RETURNS TRIGGER AS $$ | ||
DECLARE | ||
_new record; | ||
BEGIN | ||
_new := NEW; | ||
_new."updated_at" = NOW(); | ||
RETURN _new; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
CREATE TRIGGER "set_public_campaign_updated_at" | ||
BEFORE UPDATE ON "public"."campaign" | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); | ||
COMMENT ON TRIGGER "set_public_campaign_updated_at" ON "public"."campaign" | ||
IS 'trigger to set value of column "updated_at" to current timestamp on row update'; |
3 changes: 3 additions & 0 deletions
3
hasura/migrations/punkga-pg/1696925571640_drop_table_public_bookshelf/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- DROP table "public"."bookshelf"; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1696925571640_drop_table_public_bookshelf/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP table "public"."bookshelf"; |
4 changes: 4 additions & 0 deletions
4
...rations/punkga-pg/1696925592967_alter_table_public_quests_add_column_campaign_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- alter table "public"."quests" add column "campaign_id" integer | ||
-- not null; |
2 changes: 2 additions & 0 deletions
2
...igrations/punkga-pg/1696925592967_alter_table_public_quests_add_column_campaign_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alter table "public"."quests" add column "campaign_id" integer | ||
not null; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1696925872449_set_fk_public_quests_campaign_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."quests" drop constraint "quests_campaign_id_fkey"; |
5 changes: 5 additions & 0 deletions
5
hasura/migrations/punkga-pg/1696925872449_set_fk_public_quests_campaign_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."quests" | ||
add constraint "quests_campaign_id_fkey" | ||
foreign key ("campaign_id") | ||
references "public"."campaign" | ||
("id") on update restrict on delete restrict; |
4 changes: 4 additions & 0 deletions
4
...grations/punkga-pg/1696998234138_alter_table_public_quests_add_column_created_at/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- alter table "public"."quests" add column "created_at" timestamptz | ||
-- null default now(); |
2 changes: 2 additions & 0 deletions
2
...migrations/punkga-pg/1696998234138_alter_table_public_quests_add_column_created_at/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alter table "public"."quests" add column "created_at" timestamptz | ||
null default now(); |
21 changes: 21 additions & 0 deletions
21
...grations/punkga-pg/1696998238333_alter_table_public_quests_add_column_updated_at/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- alter table "public"."quests" add column "updated_at" timestamptz | ||
-- null default now(); | ||
-- | ||
-- CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() | ||
-- RETURNS TRIGGER AS $$ | ||
-- DECLARE | ||
-- _new record; | ||
-- BEGIN | ||
-- _new := NEW; | ||
-- _new."updated_at" = NOW(); | ||
-- RETURN _new; | ||
-- END; | ||
-- $$ LANGUAGE plpgsql; | ||
-- CREATE TRIGGER "set_public_quests_updated_at" | ||
-- BEFORE UPDATE ON "public"."quests" | ||
-- FOR EACH ROW | ||
-- EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); | ||
-- COMMENT ON TRIGGER "set_public_quests_updated_at" ON "public"."quests" | ||
-- IS 'trigger to set value of column "updated_at" to current timestamp on row update'; |
19 changes: 19 additions & 0 deletions
19
...migrations/punkga-pg/1696998238333_alter_table_public_quests_add_column_updated_at/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
alter table "public"."quests" add column "updated_at" timestamptz | ||
null default now(); | ||
|
||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() | ||
RETURNS TRIGGER AS $$ | ||
DECLARE | ||
_new record; | ||
BEGIN | ||
_new := NEW; | ||
_new."updated_at" = NOW(); | ||
RETURN _new; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
CREATE TRIGGER "set_public_quests_updated_at" | ||
BEFORE UPDATE ON "public"."quests" | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); | ||
COMMENT ON TRIGGER "set_public_quests_updated_at" ON "public"."quests" | ||
IS 'trigger to set value of column "updated_at" to current timestamp on row update'; |