mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 16:38:21 +00:00
* fixed plugin duplication bug Signed-off-by: thesynthax <kushagra1403@gmail.com> * changed it on DB level Signed-off-by: thesynthax <kushagra1403@gmail.com> * changed id to name in error dialog Signed-off-by: thesynthax <kushagra1403@gmail.com> * migrations run Signed-off-by: thesynthax <kushagra1403@gmail.com> --------- Signed-off-by: thesynthax <kushagra1403@gmail.com>
22 lines
637 B
TypeScript
22 lines
637 B
TypeScript
import { MigrationInterface, QueryRunner, TableUnique } from "typeorm";
|
|
|
|
export class AddPluginIdUniqueConstraint1747133448781 implements MigrationInterface {
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.createUniqueConstraint(
|
|
"plugins",
|
|
new TableUnique({
|
|
name: "UQ_plugin_pluginId",
|
|
columnNames: ["plugin_id"],
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.dropUniqueConstraint(
|
|
"plugins",
|
|
"UQ_plugin_pluginId"
|
|
);
|
|
}
|
|
|
|
}
|