Skip to content

Commit

Permalink
feat(hasura): update campaign tbl
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Oct 12, 2023
1 parent 7778a51 commit afe379c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
22 changes: 9 additions & 13 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,10 @@
query campaign {
campaign {
created_at
end_date
updated_at
id
name
start_date
updated_at
status
campaign_quests_aggregate(where: {status:{_eq:"Publish"}}) {
aggregate {
count
Expand All @@ -854,8 +853,7 @@
updated_at
id
name
start_date
end_date
status
campaign_quests {
created_at
updated_at
Expand All @@ -880,25 +878,23 @@
}
- name: Admin - Create Campaign
query: |
mutation insert_campaign_one ($name: String = "", $start_date: timestamptz = "", $end_date: timestamptz = "") {
insert_campaign(objects: {name:$name,start_date:$start_date,end_date:$end_date}) {
mutation insert_campaign_one ($name: String = "", $status: String = "") {
insert_campaign(objects: {name:$name,status:$status}) {
returning {
id
name
start_date
end_date
status
}
}
}
- name: Admin - Update campaign
query: |
mutation update_campaign ($id: Int!, $name: String = "", $start_date: timestamptz = "", $end_date: timestamptz = "") {
update_campaign(where: {id:{_eq:$id}}, _set: {name:$name,start_date:$start_date,end_date:$end_date}) {
mutation update_campaign ($id: Int!, $name: String = "", $status: String = "") {
update_campaign(where: {id:{_eq:$id}}, _set: {name:$name,status:$status}) {
returning {
id
name
start_date
end_date
status
updated_at
}
affected_rows
Expand Down
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"."campaign" add column "status" text
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."campaign" add column "status" text
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."campaign" alter column "end_date" drop not null;
alter table "public"."campaign" add column "end_date" timestamptz;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."campaign" drop column "end_date" cascade;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."campaign" alter column "start_date" drop not null;
alter table "public"."campaign" add column "start_date" timestamptz;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."campaign" drop column "start_date" cascade;

0 comments on commit afe379c

Please sign in to comment.