import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; export class RefreshPrimaryChange1724573307851 implements MigrationInterface { name = "RefreshPrimaryChange1724573307851"; public async up(queryRunner: QueryRunner): Promise { await queryRunner.dropColumn("refresh", "id"); await queryRunner.createPrimaryKey("refresh", ["token", "userId"]); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.dropPrimaryKey("refresh"); await queryRunner.addColumn( "refresh", new TableColumn({ name: "id", type: "int", isPrimary: true, isNullable: false, isGenerated: true, generationStrategy: "increment", }) ); } }