-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New query * New query for top selling channels * Add materialized view into view migrations * Fix build * Add new migration * Adjust migration and resolver * Small fixes * Make creator token just a view * Fix divison by zero * Correct hot and cold tokens * Make field more generic and increase the period * Major view query rework * Make initial price on amm start correct * Rework resolver extensions * Add new db table * Add new handler for the auth server to record interactions * Add resolver to get most interacted entities for given type * Introduce limiting for custom resolvers * Fix token price change resolver * Fix marketplace token view definition * Introduce user based rate limiting per type and entity * CR fixes * Add tests for user interactions endpoint * Fix build * Fix resolver for most interacted entity * fix: db views generation * debug log * undo: debug log * regenerate auth api docs * change view name from 'marketplace_tokens' to 'marketplace_token' * fix: lint issue --------- Co-authored-by: Zeeshan Akram <97m.zeeshan@gmail.com>
- Loading branch information
1 parent
294dddf
commit 84eeb43
Showing
23 changed files
with
1,038 additions
and
21 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
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 @@ | ||
module.exports = class Data1721141313646 { | ||
name = 'Data1721141313646' | ||
|
||
async up(db) { | ||
await db.query(`CREATE TABLE "admin"."user_interaction_count" ("id" character varying NOT NULL, "type" text, "entity_id" text, "day_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "count" integer NOT NULL, CONSTRAINT "PK_8e334a51febcf02c54dff48147d" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE INDEX "IDX_b5261af5f3fe48d77086ebc602" ON "admin"."user_interaction_count" ("day_timestamp") `) | ||
await db.query(`CREATE TABLE "admin"."marketplace_token" ("liquidity" integer, "market_cap" numeric, "cumulative_revenue" numeric, "amm_volume" numeric, "price_change" numeric, "liquidity_change" numeric, "id" character varying NOT NULL, "status" character varying(6) NOT NULL, "avatar" jsonb, "total_supply" numeric NOT NULL, "is_featured" boolean NOT NULL, "symbol" text, "is_invite_only" boolean NOT NULL, "annual_creator_reward_permill" integer NOT NULL, "revenue_share_ratio_permill" integer NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, "channel_id" text, "description" text, "whitelist_applicant_note" text, "whitelist_applicant_link" text, "accounts_num" integer NOT NULL, "number_of_revenue_share_activations" integer NOT NULL, "deissued" boolean NOT NULL, "current_amm_sale_id" text, "current_sale_id" text, "current_revenue_share_id" text, "number_of_vested_transfer_issued" integer NOT NULL, "last_price" numeric, CONSTRAINT "PK_d836a8c3d907b67099c140c4d84" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE INDEX "IDX_1268fd020cf195b2e8d5d85093" ON "admin"."marketplace_token" ("symbol") `) | ||
await db.query(`CREATE INDEX "IDX_b99bb1ecee77f23016f6ef687c" ON "admin"."marketplace_token" ("created_at") `) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`DROP TABLE "admin"."user_interaction_count"`) | ||
await db.query(`DROP INDEX "admin"."IDX_b5261af5f3fe48d77086ebc602"`) | ||
await db.query(`DROP TABLE "admin"."marketplace_token"`) | ||
await db.query(`DROP INDEX "admin"."IDX_1268fd020cf195b2e8d5d85093"`) | ||
await db.query(`DROP INDEX "admin"."IDX_b99bb1ecee77f23016f6ef687c"`) | ||
} | ||
} |
11 changes: 9 additions & 2 deletions
11
db/migrations/1720623003800-Views.js → db/migrations/1721141313757-Views.js
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.