generated from eldargab/hydra-template
-
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.
Merge pull request #247 from kodadot/test-in-prod
test in prod
- Loading branch information
Showing
15 changed files
with
169 additions
and
69 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = class Data1681650285646 { | ||
name = 'Data1681650285646' | ||
|
||
async up(db) { | ||
await db.query(`CREATE TABLE "property" ("id" character varying NOT NULL, "key" text NOT NULL, "value" text NOT NULL, "type" text NOT NULL, "mutable" boolean NOT NULL, "nft_id" character varying, CONSTRAINT "PK_d80743e6191258a5003d5843b4f" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE INDEX "IDX_e8ead80cf8ed86716aa80ef45e" ON "property" ("nft_id") `) | ||
await db.query(`ALTER TABLE "property" ADD CONSTRAINT "FK_e8ead80cf8ed86716aa80ef45e7" FOREIGN KEY ("nft_id") REFERENCES "nft_entity"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`DROP TABLE "property"`) | ||
await db.query(`DROP INDEX "public"."IDX_e8ead80cf8ed86716aa80ef45e"`) | ||
await db.query(`ALTER TABLE "property" DROP CONSTRAINT "FK_e8ead80cf8ed86716aa80ef45e7"`) | ||
} | ||
} |
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 @@ | ||
module.exports = class Data1681650453802 { | ||
name = 'Data1681650453802' | ||
|
||
async up(db) { | ||
await db.query(`ALTER TABLE "part" ALTER COLUMN "z" DROP NOT NULL`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`ALTER TABLE "part" ALTER COLUMN "z" SET NOT NULL`) | ||
} | ||
} |
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
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
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,32 @@ | ||
import { Field, ObjectType } from 'type-graphql'; | ||
|
||
@ObjectType() | ||
export class ChildItemEntity { | ||
@Field(() => String, { nullable: false }) | ||
id!: string | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '' }) | ||
name!: string | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '' }) | ||
image!: string | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '' }) | ||
media!: string | ||
|
||
@Field(() => Boolean, { nullable: false }) | ||
pending!: boolean | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '', name: 'resourceMetadata' }) | ||
resource_metadata!: string | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '', name: 'resourceSrc' }) | ||
resource_src!: string | ||
|
||
@Field(() => String, { nullable: true, defaultValue: '', name: 'resourceThumb' }) | ||
resource_thumb!: string | ||
|
||
constructor(props: Partial<ChildItemEntity>) { | ||
Object.assign(this, props); | ||
} | ||
} |
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
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 @@ | ||
import { Arg, Query, Resolver } from 'type-graphql' | ||
import type { EntityManager } from 'typeorm' | ||
import { NFTEntity } from '../../model' | ||
import { ChildItemEntity } from '../model/child.model' | ||
import { childItemsQuery } from '../query/nft' | ||
import { makeQuery } from '../utils' | ||
|
||
|
||
|
||
@Resolver() | ||
export class ChildResolver { | ||
constructor(private tx: () => Promise<EntityManager>) {} | ||
|
||
@Query(() => [ChildItemEntity]) | ||
async childListByNftId( | ||
@Arg('id', { nullable: false }) id: string, | ||
): Promise<ChildItemEntity[]> { | ||
const result: ChildItemEntity[] = await makeQuery(this.tx, NFTEntity, childItemsQuery, [id]) | ||
return result | ||
} | ||
} |
Oops, something went wrong.