mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
* Added set-default API * Setting default workspace for super-admin onboarding * Seperated the migrations * Added nestjs init * removed nestjs init * Added: default workspace case to signup * Fixed: instance signup * Fixed: existed non-active user instance signup * Added: SSO default workspace support * Added: Default workspace chooser * Moved some scss changes to ee folder * Added: disable workspace default organization check * updated the migration * Fixing .env issue * Removed the logs * Remove personal workspace check from enable signup * Fixing sign-in cases * Fixing workspace invited user's instance signup cases * Fixing sso workspace invited user's instance signup cases * fixing the workspace signup issue * Adding ee server and frontend file * Adding ee server and frontend file * Adding active check * Added query fix for the migration * Added migration logic fix * Removed/Commented the ENABLE_ONBOARDING_QUESTIONS_FOR_ALL_SIGN_UPS env support from EE and CE * Adding server and frontend files * Added frontend file * Bump version
30 lines
979 B
TypeScript
30 lines
979 B
TypeScript
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
|
|
|
|
export class AddIsDefaultToOrganizations1740401000000 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
// Add is_default column
|
|
await queryRunner.addColumn(
|
|
'organizations',
|
|
new TableColumn({
|
|
name: 'is_default',
|
|
type: 'boolean',
|
|
default: false,
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
// Create a partial unique index to ensure only one default workspace
|
|
await queryRunner.query(`
|
|
CREATE UNIQUE INDEX idx_organizations_single_default
|
|
ON organizations (is_default)
|
|
WHERE is_default = true;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
// Drop the unique index first
|
|
await queryRunner.query(`DROP INDEX IF EXISTS idx_organizations_single_default;`);
|
|
// Then drop the column
|
|
await queryRunner.dropColumn('organizations', 'is_default');
|
|
}
|
|
}
|