Skip to content

Commit

Permalink
Use failsafe tablename
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun committed Dec 12, 2023
1 parent 639d740 commit 18ebe45
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Migration } from "@mikro-orm/migrations";

export class Migration20231206123505 extends Migration {
async up(): Promise<void> {
const result = await this.execute(`select count(*) from "Migrations" where name = 'Migration20230831110518';`);
const result = await this.execute(
`select count(*) from "${this.config.get("migrations").tableName}" where name = 'Migration20230831110518';`,
);
if (result[0].count == 1) {
this.addSql('drop table if exists "UserContentScopes";');
this.addSql('drop table if exists "UserPermission";');
Expand Down

0 comments on commit 18ebe45

Please sign in to comment.