ToolJet/server/data-migrations/1750659565297-MigrateHiddenValueFromBooleanToJson.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

30 lines
895 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class MigrateHiddenValueFromBooleanToJson1750659565297 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE pages RENAME COLUMN hidden TO hidden_old`);
await queryRunner.query(`ALTER TABLE pages ADD COLUMN hidden jsonb`);
const pages = await queryRunner.query(`SELECT id, hidden_old FROM pages`);
for (const page of pages) {
const newValue = {
value: `{{${page.hidden_old}}}`,
fxActive: false,
};
await queryRunner.query(
`UPDATE pages SET hidden = $1 WHERE id = $2`,
[JSON.stringify(newValue), page.id]
);
}
await queryRunner.query(`ALTER TABLE pages DROP COLUMN hidden_old`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
}
}