setup and invite
This commit is contained in:
parent
03e0f90279
commit
7df7cf2697
23 changed files with 515 additions and 43 deletions
18
src/migrations/1724579024939-invite.ts
Normal file
18
src/migrations/1724579024939-invite.ts
Normal 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\``);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue