From f79abf695cbd5f0362e41b6aeb1301e390fec65b Mon Sep 17 00:00:00 2001 From: upalinski Date: Tue, 22 Oct 2024 15:24:12 +0300 Subject: [PATCH] generated code --- db/migrations/1729597576693-Data.js | 26 +++++++++++++++++++ .../generated/ddcCustomerCharge.model.ts | 23 ++++++++++++++++ .../generated/ddcCustomerDeposit.model.ts | 23 ++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 db/migrations/1729597576693-Data.js create mode 100644 src/model/generated/ddcCustomerCharge.model.ts create mode 100644 src/model/generated/ddcCustomerDeposit.model.ts diff --git a/db/migrations/1729597576693-Data.js b/db/migrations/1729597576693-Data.js new file mode 100644 index 0000000..ec7382d --- /dev/null +++ b/db/migrations/1729597576693-Data.js @@ -0,0 +1,26 @@ +module.exports = class Data1729597576693 { + name = 'Data1729597576693' + + async up(db) { + await db.query(`CREATE TABLE "ddc_customer_deposit" ("id" character varying NOT NULL, "block_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "amount" numeric NOT NULL, "account_id_id" character varying, CONSTRAINT "PK_06d927aee2abc69652853515725" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5f688e078889917be4732ade71" ON "ddc_customer_deposit" ("account_id_id") `) + await db.query(`CREATE INDEX "IDX_8736430cd5c9f0802ab319c412" ON "ddc_customer_deposit" ("block_timestamp", "amount") `) + await db.query(`CREATE TABLE "ddc_customer_charge" ("id" character varying NOT NULL, "block_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "amount" numeric NOT NULL, "account_id_id" character varying, CONSTRAINT "PK_8ea116156bd184ae6562ab4ec1c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_dd29caa38eb21330313a488320" ON "ddc_customer_charge" ("account_id_id") `) + await db.query(`CREATE INDEX "IDX_6e14d7e766037ec89c1f64a9a4" ON "ddc_customer_charge" ("block_timestamp", "amount") `) + await db.query(`ALTER TABLE "ddc_customer_deposit" ADD CONSTRAINT "FK_5f688e078889917be4732ade716" FOREIGN KEY ("account_id_id") REFERENCES "account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ddc_customer_charge" ADD CONSTRAINT "FK_dd29caa38eb21330313a4883208" FOREIGN KEY ("account_id_id") REFERENCES "account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + } + + async down(db) { + await db.query(`DROP TABLE "ddc_customer_deposit"`) + await db.query(`DROP INDEX "public"."IDX_5f688e078889917be4732ade71"`) + await db.query(`DROP INDEX "public"."IDX_8736430cd5c9f0802ab319c412"`) + await db.query(`DROP TABLE "ddc_customer_charge"`) + await db.query(`DROP INDEX "public"."IDX_dd29caa38eb21330313a488320"`) + await db.query(`DROP INDEX "public"."IDX_6e14d7e766037ec89c1f64a9a4"`) + await db.query(`DROP INDEX "public"."IDX_32e2c1d3ddd2960a09dc90c9ea"`) + await db.query(`ALTER TABLE "ddc_customer_deposit" DROP CONSTRAINT "FK_5f688e078889917be4732ade716"`) + await db.query(`ALTER TABLE "ddc_customer_charge" DROP CONSTRAINT "FK_dd29caa38eb21330313a4883208"`) + } +} diff --git a/src/model/generated/ddcCustomerCharge.model.ts b/src/model/generated/ddcCustomerCharge.model.ts new file mode 100644 index 0000000..6ce02bf --- /dev/null +++ b/src/model/generated/ddcCustomerCharge.model.ts @@ -0,0 +1,23 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, DateTimeColumn as DateTimeColumn_, ManyToOne as ManyToOne_, BigIntColumn as BigIntColumn_} from "@subsquid/typeorm-store" +import {Account} from "./account.model" + +@Index_(["blockTimestamp", "amount"], {unique: false}) +@Entity_() +export class DdcCustomerCharge { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @DateTimeColumn_({nullable: false}) + blockTimestamp!: Date + + @Index_() + @ManyToOne_(() => Account, {nullable: true}) + accountId!: Account + + @BigIntColumn_({nullable: false}) + amount!: bigint +} diff --git a/src/model/generated/ddcCustomerDeposit.model.ts b/src/model/generated/ddcCustomerDeposit.model.ts new file mode 100644 index 0000000..16f101c --- /dev/null +++ b/src/model/generated/ddcCustomerDeposit.model.ts @@ -0,0 +1,23 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, DateTimeColumn as DateTimeColumn_, ManyToOne as ManyToOne_, BigIntColumn as BigIntColumn_} from "@subsquid/typeorm-store" +import {Account} from "./account.model" + +@Index_(["blockTimestamp", "amount"], {unique: false}) +@Entity_() +export class DdcCustomerDeposit { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @DateTimeColumn_({nullable: false}) + blockTimestamp!: Date + + @Index_() + @ManyToOne_(() => Account, {nullable: true}) + accountId!: Account + + @BigIntColumn_({nullable: false}) + amount!: bigint +}