ToolJet/server/migrations/1646823984673-OrganizationConfigs.ts
Midhun G S 0545528504
Support for multiple workspaces 🚀 (#2778)
* multi org changes

* Initial changes

* changes

* manage sso page

* Multi-organization changes

* Multi organization changes

* multi-org changes

* multi-org changes

* multi-org changes

* multi-org fixes

* env variables app.json changes

* multi-org-fix

* user invitation token fix

* multi-org group permission fix

* multi-org app privilege

* google oauth fix

* Remove enable signup for form login

* Multi organization fixes

* multi-org user invite flow changes

* multi-org sign up fix

* rebase and multi-org fixes

* revert testing logs

* test logs revert

* migration changes

* migration file fix

* error message changes

* git login for private email fix

* dropdown fix

* test cases

* e2e test cases added

* test cases fix

* documentation changes

* testcases fix

* testcases added

* replace findOne with findOneOrFail

* accept invite testcases

* login page fixes

* added encrypted tag

* review comments

* migration fixes

* improvements

* manage sso loading fix

* review comments

* migration file changes

* new organization creation bug fix

* added e2e testcases

* added testcases

* Update data_sources.controller.ts
2022-05-05 12:38:42 +05:30

65 lines
1.6 KiB
TypeScript

import { MigrationInterface, QueryRunner, Table, TableForeignKey } from 'typeorm';
export class OrganizationConfigs1646823984673 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'sso_configs',
columns: [
{
name: 'id',
type: 'uuid',
isGenerated: true,
default: 'gen_random_uuid()',
isPrimary: true,
},
{
name: 'organization_id',
type: 'uuid',
isNullable: false,
},
{
name: 'sso',
type: 'varchar',
isNullable: false,
},
{
name: 'configs',
type: 'json',
isNullable: true,
},
{
name: 'enabled',
type: 'boolean',
default: true,
},
{
name: 'created_at',
type: 'timestamp',
isNullable: true,
default: 'now()',
},
{
name: 'updated_at',
type: 'timestamp',
isNullable: true,
default: 'now()',
},
],
}),
true
);
await queryRunner.createForeignKey(
'sso_configs',
new TableForeignKey({
columnNames: ['organization_id'],
referencedColumnNames: ['id'],
referencedTableName: 'organizations',
onDelete: 'CASCADE',
})
);
}
public async down(queryRunner: QueryRunner): Promise<void> {}
}