Merge remote-tracking branch 'origin/master' into

1794-feature-event-protocol-1-implement-the-basics-of-the-business-event-protocol
remove EnumEventType table
This commit is contained in:
Claus-Peter Hübner 2022-07-07 01:47:07 +02:00
parent f3be93e072
commit c570e5d2e5
4 changed files with 3 additions and 17 deletions

View File

@ -1,13 +0,0 @@
import { BaseEntity, Entity, Column, PrimaryColumn } from 'typeorm'
@Entity('enum_event_type')
export class EnumEventType extends BaseEntity {
@PrimaryColumn({ name: 'key', length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
key: string
@Column({ name: 'value', unsigned: true, nullable: false })
value: number
@Column({ length: 200, nullable: false, collation: 'utf8mb4_unicode_ci' })
description: string
}

View File

@ -1 +0,0 @@
export { EnumEventType } from './0041-add_event_protocol_table/EnumEventType'

View File

@ -7,7 +7,6 @@ import { TransactionLink } from './TransactionLink'
import { User } from './User'
import { Contribution } from './Contribution'
import { EventProtocol } from './EventProtocol'
import { EnumEventType } from './EnumEventType'
export const entities = [
Contribution,
@ -19,5 +18,4 @@ export const entities = [
TransactionLink,
User,
EventProtocol,
EnumEventType,
]

View File

@ -20,6 +20,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
\`amount\` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (\`id\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`)
/*
await queryFn(`
CREATE TABLE IF NOT EXISTS \`enum_event_type\` (
\`key\` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
@ -93,10 +94,11 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
await queryFn(
`INSERT INTO \`enum_event_type\` (\`key\`, \`value\`, \`description\`) VALUES ('CONTRIBUTION_LINK_ACTIVATE_REDEEM', 71, 'ContributionLinkActivateRedeemEvent: the user activates a received contributionLink to create a contribution entry for the contributionLink');`,
)
*/
}
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
// write downgrade logic as parameter of queryFn
await queryFn(`DROP TABLE IF EXISTS \`event_protocol\`;`)
await queryFn(`DROP TABLE IF EXISTS \`enum_event_type\`;`)
// await queryFn(`DROP TABLE IF EXISTS \`enum_event_type\`;`)
}