From e769390868d430127697783cbd0579008773c01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Thu, 9 Jun 2022 22:54:26 +0200 Subject: [PATCH] correct nullable columns vs nullable attributes --- backend/src/graphql/model/ContributionLink.ts | 20 +++++++++---------- .../0037-add_contribution_links_table.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/graphql/model/ContributionLink.ts b/backend/src/graphql/model/ContributionLink.ts index dd4b65aee..427def187 100644 --- a/backend/src/graphql/model/ContributionLink.ts +++ b/backend/src/graphql/model/ContributionLink.ts @@ -31,8 +31,8 @@ export class ContributionLink { @Field(() => String) code: string - @Field(() => Date, { nullable: true }) - createdAt: Date | null + @Field(() => Date) + createdAt: Date @Field(() => String) cycle: string @@ -46,17 +46,17 @@ export class ContributionLink { @Field(() => Int) id?: number - @Field(() => Boolean, { nullable: true }) - linkEnabled: boolean | null + @Field(() => Boolean) + linkEnabled: boolean @Field(() => String) link: string - @Field(() => Decimal) - maxAccountBalance: Decimal + @Field(() => Decimal, { nullable: true }) + maxAccountBalance: Decimal | null - @Field(() => Decimal) - maxAmountPerMonth: Decimal + @Field(() => Decimal, { nullable: true }) + maxAmountPerMonth: Decimal | null @Field(() => String) memo: string @@ -70,8 +70,8 @@ export class ContributionLink { @Field(() => Int) repetition: number - @Field(() => Date, { nullable: true }) - startDate: Date | null + @Field(() => Date) + startDate: Date @Field(() => Int, { nullable: true }) totalMaxCountOfContribution: number | null diff --git a/database/migrations/0037-add_contribution_links_table.ts b/database/migrations/0037-add_contribution_links_table.ts index 76956faa8..3ac6821d6 100644 --- a/database/migrations/0037-add_contribution_links_table.ts +++ b/database/migrations/0037-add_contribution_links_table.ts @@ -12,7 +12,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis \`id\` int(10) unsigned NOT NULL AUTO_INCREMENT, \`name\` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, \`memo\` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - \`valid_from\` datetime NULL, + \`valid_from\` datetime NOT NULL, \`valid_to\` datetime NULL, \`amount\` bigint(20) NOT NULL, \`cycle\` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ONCE',