From 7913dd8bb90774fa7ca783e5ae66ba10edd55fb6 Mon Sep 17 00:00:00 2001 From: dmolinari Date: Sat, 18 Apr 2026 09:39:00 -0300 Subject: [PATCH] chore(udt-011): V015_ROLLBACK script for timezone views --- database/migrations/V015_ROLLBACK.sql | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 database/migrations/V015_ROLLBACK.sql diff --git a/database/migrations/V015_ROLLBACK.sql b/database/migrations/V015_ROLLBACK.sql new file mode 100644 index 0000000..a0e5546 --- /dev/null +++ b/database/migrations/V015_ROLLBACK.sql @@ -0,0 +1,37 @@ +-- V015_ROLLBACK.sql +-- Reversa de V015__create_local_timezone_views.sql. +-- +-- Elimina: dbo.v_AuditEvent_Local + dbo.v_SecurityEvent_Local +-- No toca datos: las tablas base AuditEvent y SecurityEvent no se modifican. +-- +-- Idempotente: seguro para re-ejecutar. +-- Prerequisito: ningún objeto dependa de estas vistas (funciones, SPs, otras vistas). + +SET QUOTED_IDENTIFIER ON; +SET ANSI_NULLS ON; +SET NOCOUNT ON; +GO + +IF OBJECT_ID('dbo.v_AuditEvent_Local', 'V') IS NOT NULL +BEGIN + DROP VIEW dbo.v_AuditEvent_Local; + PRINT 'View dbo.v_AuditEvent_Local dropped.'; +END +ELSE + PRINT 'View dbo.v_AuditEvent_Local does not exist — skip.'; +GO + +IF OBJECT_ID('dbo.v_SecurityEvent_Local', 'V') IS NOT NULL +BEGIN + DROP VIEW dbo.v_SecurityEvent_Local; + PRINT 'View dbo.v_SecurityEvent_Local dropped.'; +END +ELSE + PRINT 'View dbo.v_SecurityEvent_Local does not exist — skip.'; +GO + +PRINT ''; +PRINT 'V015 rolled back.'; +PRINT ' - dbo.v_AuditEvent_Local removed.'; +PRINT ' - dbo.v_SecurityEvent_Local removed.'; +GO