ToolJet/server/data-migrations/1750927057649-AddAiGenerationFlagsInApp.ts
NishidhJain11 fb7c751a34
Feat/AI modularisation (#13142)
* fix deps

* Modularisation changes for Build with AI feature

* New app loading UI for Build with AI feature & added animation for chat messages

* Fix Error using AI feature

* add missing services and logic

* fix app gen

* update submodules

* EE frontend submodule updated

* update submodules

* EE frontend submodule updated post sync

* Added Artifact Preview component to ee moddules list

* Updated ai slice code

* app gen changes

* Resolved fix with AI bugs

* Resolved AI Copilot bugs

* app gen changes and query fixes

* fix query generation bugs

* update copilot

* Resolved ChatMode dropdown & popover bug fix

* Resolved PR suggestions & PreviewBox component in CE edition

* Synced frontend/ee with main

* Synced server/ee with main branch

* Enhance submodule checkout process to handle branch existence and fallback to main (#13218)

* Enhance submodule checkout process to handle branch existence and fallback to main

* Improve submodule checkout process to handle branch validation and fallback to main

* chore: Comment out Node.js setup, dependency installation, and build steps in cloud frontend workflow

* refactor: Enhance submodule checkout process to include submodule name in logs

* Update submodule checkout process to use the correct submodule name extraction method

* fix: Update submodule checkout script to use correct submodule path variable

* Improve submodule checkout process to correctly handle branch names and fallback to main

* chore: Uncomment Node.js setup, dependency installation, and build steps in cloud frontend workflow

* fix: Update branch checkout logic to use correct syntax and improve fallback handling

* fix: Update git checkout command to use -B flag for branch creation

* fix: Improve submodule checkout process to explicitly fetch branch ref before checkout

* fix: Enhance submodule checkout process with improved branch validation and error handling

* fix: Improve branch checkout logic by enhancing fetch command and validating branch existence

* fix: Enhance manual Git checkout process with improved fetch and error handling

* fix: Restore Node.js setup, dependency installation, and Netlify deployment steps in workflow

* 🔄 chore: update submodules to latest main after auto-merge

* Took sync of fix/appbuilder-02 in frontend/ee

---------

Co-authored-by: Kartik Gupta <gupta.kartik18kg@gmail.com>
Co-authored-by: Adish M <44204658+adishM98@users.noreply.github.com>
Co-authored-by: adishM98 Bot <adish.madhu@gmail.com>
2025-07-07 15:11:58 +05:30

62 lines
1.7 KiB
TypeScript

import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
export class AddAiGenerationFlagsInApp1750927057649 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
// Add is_initialised_from_prompt column
await queryRunner.addColumn(
'apps',
new TableColumn({
name: 'is_initialised_from_prompt',
type: 'boolean',
default: false,
isNullable: false,
})
);
// Add app_generated_from_prompt column
await queryRunner.addColumn(
'apps',
new TableColumn({
name: 'app_generated_from_prompt',
type: 'boolean',
default: false,
isNullable: false,
})
);
// Add ai_generation_metadata column
await queryRunner.addColumn(
'apps',
new TableColumn({
name: 'ai_generation_metadata',
type: 'jsonb',
isNullable: true,
})
);
// Create app_builder_mode enum type
await queryRunner.query(`CREATE TYPE "app_builder_mode" AS ENUM ('ai', 'visual')`);
// Add app_builder_mode column
await queryRunner.addColumn(
'apps',
new TableColumn({
name: 'app_builder_mode',
type: 'app_builder_mode',
default: "'visual'",
isNullable: false,
})
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
// Remove columns in reverse order
await queryRunner.dropColumn('apps', 'app_builder_mode');
await queryRunner.query('DROP TYPE "app_builder_mode"');
await queryRunner.dropColumn('apps', 'ai_generation_metadata');
await queryRunner.dropColumn('apps', 'app_generated_from_prompt');
await queryRunner.dropColumn('apps', 'is_initialised_from_prompt');
}
}