-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Fix migrations for MySQL/MariaDB (#6591)
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/cli/src/databases/migrations/mysqldb/1690000000031-FixExecutionDataType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { MigrationContext, IrreversibleMigration } from '@db/types'; | ||
|
||
export class FixExecutionDataType1690000000031 implements IrreversibleMigration { | ||
async up({ queryRunner, tablePrefix }: MigrationContext) { | ||
/** | ||
* SeparateExecutionData migration for MySQL/MariaDB accidentally changed the data-type for `data` column to `TEXT`. | ||
* This migration changes it back. | ||
* The previous migration has been patched to avoid converting to `TEXT`, which might fail. | ||
* | ||
* For any users who already ran the previous migration, this migration should fix the column type. | ||
* For any users who run these migrations in the same batch, this migration would be no-op, as the column type is already `MEDIUMTEXT` | ||
*/ | ||
await queryRunner.query( | ||
'ALTER TABLE `' + tablePrefix + 'execution_data` MODIFY COLUMN `data` MEDIUMTEXT', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters