chore(migration): drop jwtRefreshToken column from User and StatusPagePrivateUser tables

- remove jwtRefreshToken property from User model
- add migration to drop column from User and StatusPagePrivateUser and restore it on down
- register new migration in SchemaMigrations index
This commit is contained in:
Nawaz Dhandala
2025-11-07 22:37:25 +00:00
parent be9dcbd01e
commit c01fc9ee64
3 changed files with 16 additions and 15 deletions

View File

@@ -300,21 +300,6 @@ class User extends UserModel {
})
public twoFactorAuthEnabled?: boolean = undefined;
@ColumnAccessControl({
create: [],
read: [],
update: [],
})
@TableColumn({ type: TableColumnType.ShortText })
@Column({
type: ColumnType.ShortText,
length: ColumnLength.ShortText,
nullable: true,
unique: false,
})
public jwtRefreshToken?: string = undefined;
@ColumnAccessControl({
create: [],
read: [],

View File

@@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MigrationName1762554602716 implements MigrationInterface {
public name = 'MigrationName1762554602716'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "jwtRefreshToken"`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "User" ADD "jwtRefreshToken" character varying(100)`);
}
}

View File

@@ -180,6 +180,7 @@ import { MigrationName1760357680881 } from "./1760357680881-MigrationName";
import { MigrationName1761232578396 } from "./1761232578396-MigrationName";
import { MigrationName1761834523183 } from "./1761834523183-MigrationName";
import { MigrationName1762181014879 } from "./1762181014879-MigrationName";
import { MigrationName1762554602716 } from "./1762554602716-MigrationName";
export default [
InitialMigration,
@@ -364,4 +365,5 @@ export default [
MigrationName1761232578396,
MigrationName1761834523183,
MigrationName1762181014879,
MigrationName1762554602716
];