mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
migration to create transaction_links table
This commit is contained in:
parent
437da5eeda
commit
5f5bde2f0f
25
database/migrations/0030-transaction_link.ts
Normal file
25
database/migrations/0030-transaction_link.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/* MIGRATION TO CREATE TRANSACTION_LINK TABLE */
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
CREATE TABLE \`transaction_links\` (
|
||||
\`id\` int UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
\`userId\` int UNSIGNED NOT NULL,
|
||||
\`amount\` DECIMAL(40,20) NOT NULL,
|
||||
\`memo\` varchar(255) NOT NULL,
|
||||
\`createdAt\` datetime NOT NULL,
|
||||
\`validUntil\` datetime NOT NULL,
|
||||
\`showEmail\` boolean NOT NULL DEFAULT false,
|
||||
\`redeemedAt\` datetime,
|
||||
\`redeemedBy\` int UNSIGNED,
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`DROP TABLE \`transaction_links\`;`)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user