F2 avanzada

This commit is contained in:
2026-08-10 23:00:56 -03:00
parent 12b7b0f4b2
commit b4b25e49e0
49 changed files with 1304 additions and 227 deletions
+26
View File
@@ -0,0 +1,26 @@
-- Data migration script to transfer existing patient data from AspNetUsers
-- to the new Pacientes table after cleanup migration
-- First, let's identify users who had patient data by checking related tables
-- This assumes you can determine which users were patients based on your application logic
-- Modify this query according to how you identified patients in your original implementation
SELECT 'INSERT INTOPacientes (Id, NombreContactoEmergencia, TelefonoContactoEmergencia, '
|| 'TipoSangre, TieneAlergiasMedicamentosas, AlergiasDescripcion, FechaRegistro) VALUES '
|| "('" || Id || "', 'old_value1', 'old_value2', 'O+', 0, '', UTC_TIMESTAMP());"
FROM AspNetUsers
where Discriminator = 'Paciente'; -- This won't work now since we removed the column
-- Since we already removed the discriminator and patient columns, you'll need to
-- manually identify which users were patients and use placeholders for their data
-- Example query to generate INSERT statements (modify with actual data):
-- SELECT
-- 'INSERT INTO Pacientes (Id, NombreContactoEmergencia, TelefonoContactoEmergencia, '
-- || 'TipoSangre, TieneAlergiasMedicamentosas, AlergiasDescripcion, FechaRegistro) VALUES '
-- || "('" || Id || "', '', '', '', 0, '', UTC_TIMESTAMP());"
-- FROM AspNetUsers
-- WHERE [your_condition_to_identify_patients];
-- After running the generated INSERT statements manually, verify the data:
SELECT * FROM Pacientes;