Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: data types of archived notifications table to match notifications table #363

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class HotfixArchiveTable1732200721350 implements MigrationInterface {
xixas marked this conversation as resolved.
Show resolved Hide resolved
public async up(queryRunner: QueryRunner): Promise<void> {
// Update the 'data' column type to LONGTEXT
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN data LONGTEXT;
`);

// Update the 'result' column type to LONGTEXT
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN result LONGTEXT;
`);

// Update the 'retry_count' column to INT(3)
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN retry_count INT(3) NOT NULL DEFAULT 0;
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
// Revert the 'retry_count' column to its previous type (assuming INT(11))
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN retry_count INT(11) NOT NULL DEFAULT 0;
`);

// Revert the 'data' column type to its previous type (assuming TEXT)
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN data TEXT;
`);

// Revert the 'result' column type to its previous type (assuming TEXT)
await queryRunner.query(`
ALTER TABLE notify_archived_notifications MODIFY COLUMN result TEXT;
`);
}
xixas marked this conversation as resolved.
Show resolved Hide resolved
}
Loading