ToolJet/server/migrations/1749766539146-ModifyPagesTableForDifferentNavs.ts
vjaris42 08d5cc9390
Revamp pages in viewer and editor (#13022)
* initial commit

* fix

* Fixes

* Fix dropping widget width while dragging

* Fix group selection in form

* fix when dropping a component, shadow is coming on top of component manager.

* improve performace on useGroupedTargetsScrollHandler

* Fix

* Revamp pages in editor and viewer

* bug fixes

* merge base

* fix conflicts

* fix conflicts

* bug fixes

* bug fixes

* fix: pages icon and layout for right sidebar

* fix: styling for pages menu

* fix base styling

* merge base

* bug fixes

* bug fixes

* fix top styling of nav bar

* add border to canvas

* bug fixes

* bug fixes

* update reference

* bug fix

---------

Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 17:36:32 +05:30

56 lines
1.6 KiB
TypeScript

import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
export class ModifyPagesTableForDifferentNavs1749766539146 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'pages',
new TableColumn({
name: 'url',
type: 'varchar',
isNullable: true,
})
);
if (queryRunner.connection.driver.options.type === 'postgres') {
await queryRunner.query(`
CREATE TYPE "page_open_in_enum" AS ENUM ('new_tab', 'same_tab')
`);
}
await queryRunner.addColumn(
'pages',
new TableColumn({
name: 'open_in',
type: queryRunner.connection.driver.options.type === 'postgres' ? 'page_open_in_enum' : 'varchar',
default: `'new_tab'`,
isNullable: false,
})
);
if (queryRunner.connection.driver.options.type === 'postgres') {
await queryRunner.query(`
CREATE TYPE "page_type_enum" AS ENUM ('default', 'group', 'url', 'app')
`);
}
await queryRunner.addColumn(
'pages',
new TableColumn({
name: 'type',
type: queryRunner.connection.driver.options.type === 'postgres' ? 'page_type_enum' : 'varchar',
default: `'default'`,
isNullable: false,
})
);
await queryRunner.addColumn(
'pages',
new TableColumn({
name: 'app_id',
type: 'varchar',
isNullable: false,
default: `''`,
})
);
}
public async down(queryRunner: QueryRunner): Promise<void> {}
}