mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-22 05:57:20 +00:00
* added unique key constrain to organization users * fix * fix * added logs and comments * test case fixes * resolve fail test * resolve tests google auth * comment out organization id checks * remove all e2e tests changes * comment tests * test case fixes * resolve fail test * resolve tests google auth * revert all changes * fix for test cases * test case fixes * revert all test case changes * refractor --------- Co-authored-by: Anantshree Chandola <anantshreechandola23@gmail.com>
18 lines
723 B
TypeScript
18 lines
723 B
TypeScript
import { DataBaseConstraints } from 'src/helpers/db_constraints.constants';
|
|
import { MigrationInterface, QueryRunner, TableUnique } from 'typeorm';
|
|
|
|
export class addUniqueKeyConstrainForOrganizationUsers1693309526388 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.createUniqueConstraint(
|
|
'organization_users',
|
|
new TableUnique({
|
|
name: DataBaseConstraints.USER_ORGANIZATION_UNIQUE,
|
|
columnNames: ['user_id', 'organization_id'],
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.dropUniqueConstraint('organization_users', DataBaseConstraints.USER_ORGANIZATION_UNIQUE);
|
|
}
|
|
}
|