[Mapbender_dev] Re: [Mapbender] #819: WMC Update to 2.7
Mapbender
mapbender_dev at lists.osgeo.org
Thu Apr 28 07:19:55 EDT 2011
#819: WMC Update to 2.7
--------------------------+-------------------------------------------------
Reporter: marc | Owner: dev
Type: defect | Status: new
Priority: major | Milestone: 2.7.2 release
Component: installation | Version: 2.7.1
Keywords: |
--------------------------+-------------------------------------------------
Comment(by marc):
a sollution [[BR]]
'''before running the update script.'''
change following line (611) of update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
[[BR]]
{{{
--UPDATE mb_user_wmc SET wmc_serial_id =
NEXTVAL('mb_user_wmc_wmc_serial_id_seq'); TODO: this is only for older
installations - if a serial column exists before, the serial ids will be
updated - that is not what we want cause this are the references!
}}}
to
{{{
UPDATE mb_user_wmc SET wmc_serial_id =
NEXTVAL('mb_user_wmc_wmc_serial_id_seq') WHERE wmc_serial_id is null;
}}}
'''or do this manually afterwards...'''[[BR]]
by running this sql.
{{{
UPDATE mb_user_wmc SET wmc_serial_id =
NEXTVAL('mb_user_wmc_wmc_serial_id_seq') WHERE wmc_serial_id is null;
CREATE TABLE wmc_keyword (
fkey_keyword_id INTEGER REFERENCES keyword(keyword_id) ON DELETE
CASCADE ON UPDATE CASCADE,
fkey_wmc_serial_id INTEGER REFERENCES mb_user_wmc(wmc_serial_id)
ON DELETE CASCADE ON UPDATE CASCADE
);
ALTER TABLE ONLY wmc_keyword
ADD CONSTRAINT pk_wmc_keyword PRIMARY KEY (fkey_wmc_serial_id,
fkey_keyword_id);
--adopt relation for old implementations:
--create a new one and drop the old!
--new categories for publishing -> custom , inspire ?
-- Table: wmc_custom_category
CREATE TABLE wmc_md_topic_category
(
fkey_wmc_serial_id integer NOT NULL,
fkey_md_topic_category_id integer NOT NULL,
CONSTRAINT wmc_topic_category_fkey_wmc_serial_id_fkey FOREIGN KEY
(fkey_wmc_serial_id)
REFERENCES mb_user_wmc (wmc_serial_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT wmc_topic_category_fkey_md_topic_category_id_fkey FOREIGN KEY
(fkey_md_topic_category_id)
REFERENCES md_topic_category (md_topic_category_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
);
--new categories for publishing -> custom , inspire ?
-- Table: wmc_custom_category
CREATE TABLE wmc_custom_category
(
fkey_wmc_serial_id integer NOT NULL,
fkey_custom_category_id integer NOT NULL,
CONSTRAINT wmc_custom_category_fkey_wmc_serial_id_fkey FOREIGN KEY
(fkey_wmc_serial_id)
REFERENCES mb_user_wmc (wmc_serial_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT wmc_custom_category_fkey_custom_category_id_fkey FOREIGN KEY
(fkey_custom_category_id)
REFERENCES custom_category (custom_category_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
);
-- Table: wmc_inspire_category
CREATE TABLE wmc_inspire_category
(
fkey_wmc_serial_id integer NOT NULL,
fkey_inspire_category_id integer NOT NULL,
CONSTRAINT wmc_inspire_category_fkey_wmc_serial_id_fkey FOREIGN KEY
(fkey_wmc_serial_id)
REFERENCES mb_user_wmc (wmc_serial_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT wmc_inspire_category_fkey_inspire_category_id_fkey FOREIGN
KEY (fkey_inspire_category_id)
REFERENCES inspire_category (inspire_category_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
);
}}}
--
Ticket URL: <http://trac.osgeo.org/mapbender/ticket/819#comment:1>
Mapbender <http://www.mapbender.org/>
Mapbender
More information about the Mapbender_dev
mailing list