Onboarding
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddUserOnboardingCompleted1781000000000
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddUserOnboardingCompleted1781000000000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
if (!(await queryRunner.hasTable('users'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(await queryRunner.hasColumn('users', 'onboardingCompleted'))) {
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE `users` ADD `onboardingCompleted` tinyint NOT NULL DEFAULT 0',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
if (
|
||||
(await queryRunner.hasTable('users')) &&
|
||||
(await queryRunner.hasColumn('users', 'onboardingCompleted'))
|
||||
) {
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE `users` DROP COLUMN `onboardingCompleted`',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class GeneratedMigration1781003163444 implements MigrationInterface {
|
||||
name = 'GeneratedMigration1781003163444'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`users\` ADD \`onboardingCompleted\` tinyint NOT NULL DEFAULT 0`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`users\` DROP COLUMN \`onboardingCompleted\``);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user