GFDRR / geonode

GFDRR Lab GeoNode
https://www.geonode-gfdrrlab.org
GNU General Public License v3.0
2 stars 3 forks source link

[int] cannot remove layer zonage_assainissement #41

Closed fvanderbiest closed 7 years ago

fvanderbiest commented 7 years ago

Removing http://int.geonode-gfdrrlab.org/layers/hazard:zonage_assainissement is currently impossible

fvanderbiest commented 7 years ago
hazard:zonage_assainissement column upload_upload.mosaic_time_regex does not exist LINE 1: ...ad_upload"."session", "upload_upload"."metadata", "upload_up... ^
fvanderbiest commented 7 years ago

One migration not applied.

fvanderbiest commented 7 years ago

SQL diff between a geonode-migrated db (from 2.4 to 2.6) and target 2.6 schema:

ALTER TABLE account_accountdeletion
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: account_accountdeletion original: character varying(75) new: character varying(254) */;

ALTER TABLE account_emailaddress
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: account_emailaddress original: character varying(75) new: character varying(254) */;

ALTER TABLE account_signupcode
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: account_signupcode original: character varying(75) new: character varying(254) */;

ALTER TABLE actstream_action
    ALTER COLUMN "data" TYPE jsonb USING data::jsonb /* TYPE change - table: actstream_action original: text new: jsonb */;

ALTER TABLE base_contactrole
    ALTER COLUMN resource_id DROP NOT NULL;

ALTER TABLE base_link
    ALTER COLUMN resource_id DROP NOT NULL;

ALTER TABLE base_resourcebase
    DROP COLUMN distribution_url,
    DROP COLUMN distribution_description;

ALTER TABLE documents_document
    DROP COLUMN distribution_description_en,
    ALTER COLUMN doc_file TYPE character varying(255) /* TYPE change - table: documents_document original: character varying(100) new: character varying(255) */,
    ALTER COLUMN doc_url TYPE character varying(255) /* TYPE change - table: documents_document original: character varying(200) new: character varying(255) */;

ALTER TABLE groups_groupinvitation
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: groups_groupinvitation original: character varying(75) new: character varying(254) */;

ALTER TABLE groups_groupprofile
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: groups_groupprofile original: character varying(75) new: character varying(254) */;

ALTER TABLE layers_layer
    DROP COLUMN distribution_description_en,
    DROP COLUMN service_id;

ALTER TABLE maps_map
    DROP COLUMN distribution_description_en;

ALTER TABLE people_profile
    ALTER COLUMN last_login DROP NOT NULL,
    ALTER COLUMN email TYPE character varying(254) /* TYPE change - table: people_profile original: character varying(75) new: character varying(254) */;

ALTER TABLE tastypie_apikey
    ALTER COLUMN "key" TYPE character varying(128) /* TYPE change - table: tastypie_apikey original: character varying(256) new: character varying(128) */;

ALTER TABLE upload_upload
    ADD COLUMN mosaic_time_regex character varying(128),
    ADD COLUMN mosaic_time_value character varying(128),
    ADD COLUMN mosaic_elev_regex character varying(128),
    ADD COLUMN mosaic_elev_value character varying(128);

Link to full upgrade script: https://gist.github.com/fvanderbiest/4974dd0c908e36b4bad6f71d11d23bb8

fvanderbiest commented 7 years ago

3 tables have dropped columns: base_resourcebase, documents_document, layers_layer To prevent data loss, we exported the data in CSV files:

fvanderbiest commented 7 years ago

Issue is now fixed on int server.

fvanderbiest commented 7 years ago

Also applied on new prod server.