From a5ea95876551c8ffee5b16ffe06bbfdc2f1df3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Fri, 27 Oct 2023 15:10:04 -0500 Subject: [PATCH] Intenta unificar regionales. Closes #244 --- Gemfile | 2 +- Gemfile.lock | 2 +- app/models/ability.rb | 2 +- .../20231027172038_unifica_regionales.rb | 30 ++++++++++++++++ db/structure.sql | 3 +- yarn.lock | 34 +++++++++---------- 6 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 db/migrate/20231027172038_unifica_regionales.rb diff --git a/Gemfile b/Gemfile index e8c95b1..342dbac 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem "heb412_gen", # Motor de nube y llenado de plantillas #path: "../heb412_gen" gem "sivel2_gen", # Motor para manejo de casos - git: "https://gitlab.com/pasosdeJesus/sivel2_gen.git", branch: "main" + git: "https://gitlab.com/pasosdeJesus/sivel2_gen.git", branch: "sinturbovic" #path: "../sivel2_gen" gem "cor1440_gen", diff --git a/Gemfile.lock b/Gemfile.lock index afd5127..9548ebc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,7 +95,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git revision: 7f4448f16811cc58c2633bba7866d99d4aac54e6 - branch: main + branch: sinturbovic specs: sivel2_gen (2.2.0.beta4) color diff --git a/app/models/ability.rb b/app/models/ability.rb index 8c8686a..c0b54ed 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -121,7 +121,7 @@ def tablasbasicas_prio } } - def self.campos_plantillas + def campos_plantillas c=Heb412Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.clone .merge(Cor1440Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.clone) .merge(Sivel2Gen::Ability::CAMPOS_PLANTILLAS_PROPIAS.clone) diff --git a/db/migrate/20231027172038_unifica_regionales.rb b/db/migrate/20231027172038_unifica_regionales.rb new file mode 100644 index 0000000..6be42e0 --- /dev/null +++ b/db/migrate/20231027172038_unifica_regionales.rb @@ -0,0 +1,30 @@ +class UnificaRegionales < ActiveRecord::Migration[7.0] + def up + execute <<-SQL + DELETE FROM regionpago WHERE id=7; + UPDATE msip_persona SET ultima_regionpago_id=12 WHERE ultima_regionpago_id=2; -- Mezcla ARMENIA en EJE CAFETERO + DELETE FROM regionpago WHERE id=2; -- ARMENIA + DELETE FROM regionpago WHERE id=7; -- CARTAGENA + UPDATE msip_persona SET ultima_regionpago_id=12 WHERE ultima_regionpago_id=13; -- Mezcla EJE CAFETERO - RISARALDA en EJE CAFETERO + DELETE FROM regionpago WHERE id=14; --EJE CAFETERO - CALDAS + DELETE FROM regionpago WHERE id=16; --EJE CAFETERO - CHOCO + DELETE FROM regionpago WHERE id=17; --EJE CAFETERO - QUINDIO + DELETE FROM regionpago WHERE id=13; --EJE CAFETERO - RISARALDA + UPDATE msip_persona SET ultima_regionpago_id=15 WHERE ultima_regionpago_id=21; -- Mezcla MEDELLIN ANTIOQUIA en ANTIOQUIA + DELETE FROM regionpago WHERE id=21; --MEDELLIN ANTIOQUIA + DELETE FROM regionpago WHERE id=22; --MEDELLIN ANTIOQUIA-RISARALDA + UPDATE msip_persona SET ultima_regionpago_id=22 WHERE ultima_regionpago_id=21; -- Mezcla MEDELLIN ANTIOQUIA - RISARALDA en ANTIOQUIA + UPDATE regionpago SET nombre='NORTE DE SANTANDER' WHERE id=23; + UPDATE msip_persona SET ultima_regionpago_id=32 WHERE ultima_regionpago_id=24; -- Mezcla PACIFICO en VALLE DEL CAUCA + DELETE FROM regionpago WHERE id=24; --PACIFICO + DELETE FROM regionpago WHERE id=25; --PASTO NARIÑO + DELETE FROM regionpago WHERE id=26; --POPAYAN + DELETE FROM regionpago WHERE id=28; --RIOHACHA GUAJIRA + UPDATE regionpago SET nombre='SANTANDER' WHERE id=29; + SQL + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/structure.sql b/db/structure.sql index fdf801c..fcf4044 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -12796,6 +12796,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20231003205337'), ('20231003222709'), ('20231007095930'), -('20231021134451'); +('20231021134451'), +('20231027172038'); diff --git a/yarn.lock b/yarn.lock index 9240d89..4018caa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -751,11 +751,11 @@ integrity sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw== "@types/node@*": - version "20.8.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.8.tgz#adee050b422061ad5255fc38ff71b2bb96ea2a0e" - integrity sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ== + version "20.8.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.9.tgz#646390b4fab269abce59c308fc286dcd818a2b08" + integrity sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg== dependencies: - undici-types "~5.25.1" + undici-types "~5.26.4" "@types/parse-json@^4.0.0": version "4.0.1" @@ -820,9 +820,9 @@ acorn@^7.1.1: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.10.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + version "8.11.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" + integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== agent-base@6: version "6.0.2" @@ -1116,9 +1116,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001541: - version "1.0.30001553" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001553.tgz#e64e7dc8fd4885cd246bb476471420beb5e474b5" - integrity sha512-N0ttd6TrFfuqKNi+pMgWJTb9qrdJu4JSpgPFLe/lrD19ugC6fZgF0pUewRowDwzdDnb9V41mFcdlYgl/PyKf4A== + version "1.0.30001555" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001555.tgz#e36f4d49e345337d6788f32093867cec8d951789" + integrity sha512-NzbUFKUnJ3DTcq6YyZB6+qqhfD112uR3uoEnkmfzm2wVzUNsFkU7AwBjKQ654Sp5cau0JxhFyRSn/tQZ+XfygA== chalk@^2.4.2: version "2.4.2" @@ -1393,9 +1393,9 @@ domexception@^2.0.1: webidl-conversions "^5.0.0" electron-to-chromium@^1.4.535: - version "1.4.565" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.565.tgz#205f3746a759ec3c43bce98b9eef5445f2721ea9" - integrity sha512-XbMoT6yIvg2xzcbs5hCADi0dXBh4//En3oFXmtPX+jiyyiCTiM9DGFT2SLottjpEs9Z8Mh8SqahbR96MaHfuSg== + version "1.4.569" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.569.tgz#1298b67727187ffbaac005a7425490d157f3ad03" + integrity sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg== emittery@^0.8.1: version "0.8.1" @@ -3363,10 +3363,10 @@ unbzip2-stream@1.4.3: buffer "^5.2.1" through "^2.3.8" -undici-types@~5.25.1: - version "5.25.3" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3" - integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== universalify@^0.2.0: version "0.2.0"