-
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.
- Loading branch information
Showing
65 changed files
with
15,341 additions
and
1,720 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -41,4 +41,5 @@ tsconfig.tsbuildinfo | |
*.pem* | ||
credentials/* | ||
|
||
src/test/**/*.json | ||
src/test/**/*.json | ||
*.exe |
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
10 changes: 10 additions & 0 deletions
10
hasura/metadata/databases/punkga-pg/tables/public_donate_history.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,10 @@ | ||
table: | ||
name: donate_history | ||
schema: public | ||
object_relationships: | ||
- name: creator | ||
using: | ||
foreign_key_constraint_on: creator_id | ||
- name: telegram_user | ||
using: | ||
foreign_key_constraint_on: telegram_id |
10 changes: 10 additions & 0 deletions
10
hasura/metadata/databases/punkga-pg/tables/public_telegram_quest_history.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,10 @@ | ||
table: | ||
name: telegram_quest_history | ||
schema: public | ||
object_relationships: | ||
- name: telegram_quest | ||
using: | ||
foreign_key_constraint_on: quest_id | ||
- name: telegram_user | ||
using: | ||
foreign_key_constraint_on: telegram_user_id |
11 changes: 11 additions & 0 deletions
11
hasura/metadata/databases/punkga-pg/tables/public_telegram_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,11 @@ | ||
table: | ||
name: telegram_quests | ||
schema: public | ||
array_relationships: | ||
- name: telegram_quest_histories | ||
using: | ||
foreign_key_constraint_on: | ||
column: quest_id | ||
table: | ||
name: telegram_quest_history | ||
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
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/1724750116003_create_table_public_donate_history/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"."donate_history"; |
17 changes: 17 additions & 0 deletions
17
hasura/migrations/punkga-pg/1724750116003_create_table_public_donate_history/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"."donate_history" ("id" serial NOT NULL, "telegram_id" text NOT NULL, "creator_id" integer NOT NULL, "txn" text NOT NULL, "value" text NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN KEY ("telegram_id") REFERENCES "public"."telegram_users"("telegram_id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("creator_id") REFERENCES "public"."creators"("id") ON UPDATE cascade ON DELETE cascade); | ||
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_donate_history_updated_at" | ||
BEFORE UPDATE ON "public"."donate_history" | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); | ||
COMMENT ON TRIGGER "set_public_donate_history_updated_at" ON "public"."donate_history" | ||
IS 'trigger to set value of column "updated_at" to current timestamp on row update'; |
2 changes: 2 additions & 0 deletions
2
...ions/punkga-pg/1724753071695_alter_table_public_donate_history_drop_column_value/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,2 @@ | ||
alter table "public"."donate_history" alter column "value" drop not null; | ||
alter table "public"."donate_history" add column "value" text; |
1 change: 1 addition & 0 deletions
1
...ations/punkga-pg/1724753071695_alter_table_public_donate_history_drop_column_value/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 @@ | ||
alter table "public"."donate_history" drop column "value" cascade; |
4 changes: 4 additions & 0 deletions
4
...tions/punkga-pg/1724753114236_alter_table_public_donate_history_add_column_value/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"."donate_history" add column "value" Integer | ||
-- null; |
2 changes: 2 additions & 0 deletions
2
...rations/punkga-pg/1724753114236_alter_table_public_donate_history_add_column_value/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"."donate_history" add column "value" Integer | ||
null; |
18 changes: 18 additions & 0 deletions
18
hasura/migrations/punkga-pg/1725436648296_update_show_album_trigger/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,18 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- CREATE OR REPLACE FUNCTION update_show_album_fnc() RETURNS trigger AS $$ | ||
-- DECLARE | ||
-- cnt integer; | ||
-- BEGIN | ||
-- SELECT count(*) INTO cnt FROM artworks a WHERE a.album_id = OLD.album_id; | ||
-- IF cnt = 0 THEN | ||
-- UPDATE albums SET show = false WHERE id = OLD.album_id; | ||
-- END IF; | ||
-- RETURN OLD; | ||
-- END; | ||
-- $$ LANGUAGE plpgsql; | ||
-- | ||
-- CREATE OR REPLACE TRIGGER update_show_album | ||
-- AFTER DELETE ON artworks | ||
-- FOR EACH ROW | ||
-- EXECUTE FUNCTION update_show_album_fnc(); |
16 changes: 16 additions & 0 deletions
16
hasura/migrations/punkga-pg/1725436648296_update_show_album_trigger/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,16 @@ | ||
CREATE OR REPLACE FUNCTION update_show_album_fnc() RETURNS trigger AS $$ | ||
DECLARE | ||
cnt integer; | ||
BEGIN | ||
SELECT count(*) INTO cnt FROM artworks a WHERE a.album_id = OLD.album_id; | ||
IF cnt = 0 THEN | ||
UPDATE albums SET show = false WHERE id = OLD.album_id; | ||
END IF; | ||
RETURN OLD; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
|
||
CREATE OR REPLACE TRIGGER update_show_album | ||
AFTER DELETE ON artworks | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_show_album_fnc(); |
4 changes: 4 additions & 0 deletions
4
...ations/punkga-pg/1725867809614_alter_table_public_telegram_users_add_column_chip/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"."telegram_users" add column "chip" bigint | ||
-- null default '0'; |
2 changes: 2 additions & 0 deletions
2
...grations/punkga-pg/1725867809614_alter_table_public_telegram_users_add_column_chip/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"."telegram_users" add column "chip" bigint | ||
null default '0'; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1726028273707_create_table_public_telegram_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"."telegram_quests"; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1726028273707_create_table_public_telegram_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"."telegram_quests" ("id" bigserial NOT NULL, "quest_name" text NOT NULL, "quest_url" text NOT NULL, "reward" bigint NOT NULL, "claim_after" integer NOT NULL DEFAULT 0, "social_source" text NOT NULL, "type" text NOT NULL, "active_from" date NOT NULL, "active_to" date NOT NULL, "activated" boolean NOT NULL DEFAULT true, "deleted" boolean NOT NULL DEFAULT false, PRIMARY KEY ("id") , UNIQUE ("id")); |
1 change: 1 addition & 0 deletions
1
...kga-pg/1726028402528_alter_table_public_telegram_quests_alter_column_active_from/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"."telegram_quests" alter column "active_from" set not null; |
1 change: 1 addition & 0 deletions
1
...unkga-pg/1726028402528_alter_table_public_telegram_quests_alter_column_active_from/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 @@ | ||
alter table "public"."telegram_quests" alter column "active_from" drop not null; |
1 change: 1 addition & 0 deletions
1
...unkga-pg/1726028409759_alter_table_public_telegram_quests_alter_column_active_to/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"."telegram_quests" alter column "active_to" set not null; |
1 change: 1 addition & 0 deletions
1
.../punkga-pg/1726028409759_alter_table_public_telegram_quests_alter_column_active_to/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 @@ | ||
alter table "public"."telegram_quests" alter column "active_to" drop not null; |
1 change: 1 addition & 0 deletions
1
...ra/migrations/punkga-pg/1726028635659_create_table_public_telegram_quest_history/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"."telegram_quest_history"; |
1 change: 1 addition & 0 deletions
1
hasura/migrations/punkga-pg/1726028635659_create_table_public_telegram_quest_history/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"."telegram_quest_history" ("id" bigserial NOT NULL, "quest_id" bigint NOT NULL, "telegram_user_id" integer NOT NULL, "is_claim" boolean NOT NULL, "created_date_utc" date NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("quest_id") REFERENCES "public"."telegram_quests"("id") ON UPDATE restrict ON DELETE no action, UNIQUE ("id")); |
5 changes: 5 additions & 0 deletions
5
...912_delete_fk_public_telegram_quest_history_telegram_quest_history_quest_id_fkey/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,5 @@ | ||
alter table "public"."telegram_quest_history" | ||
add constraint "telegram_quest_history_quest_id_fkey" | ||
foreign key ("quest_id") | ||
references "public"."telegram_quests" | ||
("id") on update restrict on delete no action; |
1 change: 1 addition & 0 deletions
1
...04912_delete_fk_public_telegram_quest_history_telegram_quest_history_quest_id_fkey/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 @@ | ||
alter table "public"."telegram_quest_history" drop constraint "telegram_quest_history_quest_id_fkey"; |
1 change: 1 addition & 0 deletions
1
...migrations/punkga-pg/1726028776296_set_fk_public_telegram_quest_history_quest_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"."telegram_quest_history" drop constraint "telegram_quest_history_quest_id_fkey"; |
5 changes: 5 additions & 0 deletions
5
...a/migrations/punkga-pg/1726028776296_set_fk_public_telegram_quest_history_quest_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"."telegram_quest_history" | ||
add constraint "telegram_quest_history_quest_id_fkey" | ||
foreign key ("quest_id") | ||
references "public"."telegram_quests" | ||
("id") on update restrict on delete no action; |
1 change: 1 addition & 0 deletions
1
...ns/punkga-pg/1726028811632_set_fk_public_telegram_quest_history_telegram_user_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"."telegram_quest_history" drop constraint "telegram_quest_history_telegram_user_id_fkey"; |
5 changes: 5 additions & 0 deletions
5
...ions/punkga-pg/1726028811632_set_fk_public_telegram_quest_history_telegram_user_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"."telegram_quest_history" | ||
add constraint "telegram_quest_history_telegram_user_id_fkey" | ||
foreign key ("telegram_user_id") | ||
references "public"."telegram_users" | ||
("id") on update restrict on delete no action; |
2 changes: 2 additions & 0 deletions
2
...31999858_alter_table_public_telegram_quest_history_alter_column_created_date_utc/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,2 @@ | ||
alter table "public"."telegram_quest_history" rename column "created_date" to "created_date_utc"; | ||
ALTER TABLE "public"."telegram_quest_history" ALTER COLUMN "created_date_utc" drop default; |
2 changes: 2 additions & 0 deletions
2
...6031999858_alter_table_public_telegram_quest_history_alter_column_created_date_utc/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"."telegram_quest_history" alter column "created_date_utc" set default now(); | ||
alter table "public"."telegram_quest_history" rename column "created_date_utc" to "created_date"; |
1 change: 1 addition & 0 deletions
1
...726032144751_alter_table_public_telegram_quest_history_alter_column_created_date/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"."telegram_quest_history" ALTER COLUMN "created_date" TYPE date; |
1 change: 1 addition & 0 deletions
1
.../1726032144751_alter_table_public_telegram_quest_history_alter_column_created_date/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 @@ | ||
ALTER TABLE "public"."telegram_quest_history" ALTER COLUMN "created_date" TYPE timestamp; |
4 changes: 4 additions & 0 deletions
4
...ga-pg/1726123938767_alter_table_public_donate_history_add_column_send_to_creator/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"."donate_history" add column "send_to_creator" boolean | ||
-- null; |
2 changes: 2 additions & 0 deletions
2
...nkga-pg/1726123938767_alter_table_public_donate_history_add_column_send_to_creator/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"."donate_history" add column "send_to_creator" boolean | ||
null; |
Oops, something went wrong.