setup and invite

This commit is contained in:
Julian Krauser 2024-08-25 13:36:19 +02:00
parent 03e0f90279
commit 7df7cf2697
23 changed files with 515 additions and 43 deletions

View file

@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Invite1724579024939 implements MigrationInterface {
name = 'Invite1724579024939'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE \`invite\` (\`mail\` varchar(255) NOT NULL, \`token\` varchar(255) NOT NULL, \`username\` varchar(255) NOT NULL, \`firstname\` varchar(255) NOT NULL, \`lastname\` varchar(255) NOT NULL, \`secret\` varchar(255) NOT NULL, PRIMARY KEY (\`mail\`)) ENGINE=InnoDB`);
await queryRunner.query(`ALTER TABLE \`user\` ADD \`firstname\` varchar(255) NOT NULL`);
await queryRunner.query(`ALTER TABLE \`user\` ADD \`lastname\` varchar(255) NOT NULL`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`user\` DROP COLUMN \`lastname\``);
await queryRunner.query(`ALTER TABLE \`user\` DROP COLUMN \`firstname\``);
await queryRunner.query(`DROP TABLE \`invite\``);
}
}