F4.6 · retirar Campañas del producto activo
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class PhaseF4RemoveSurveySubsystem1790053200000 implements MigrationInterface {
|
||||
name = 'PhaseF4RemoveSurveySubsystem1790053200000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
DELETE FROM role_permissions
|
||||
WHERE permission_id IN (
|
||||
SELECT id FROM permissions WHERE code LIKE 'surveys.%'
|
||||
)
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
DELETE FROM permissions WHERE code LIKE 'surveys.%'
|
||||
`);
|
||||
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS survey_target_report_media`);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS survey_target_report_versions`);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS survey_target_reports`);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS survey_campaign_targets`);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS survey_campaigns`);
|
||||
}
|
||||
|
||||
public async down(_queryRunner: QueryRunner): Promise<void> {
|
||||
// Intentionally irreversible: historical migrations still document the old
|
||||
// Survey schema, but restoring dropped campaign/report data would be unsafe.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user