schema/spacewalk/common/tables/rhnContentSource.sql |
4 +--
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/001-repo-sync.sql |
13 ++++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
New commits:
commit dfb1f7740dc6ebf562a78df153e9fecb7b3ee08f
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Fri Jul 2 10:31:34 2010 -0400
bug fixes to repo sync schema upgrades and sql
diff --git a/schema/spacewalk/common/tables/rhnContentSource.sql
b/schema/spacewalk/common/tables/rhnContentSource.sql
index 876dc7d..479bae8 100644
--- a/schema/spacewalk/common/tables/rhnContentSource.sql
+++ b/schema/spacewalk/common/tables/rhnContentSource.sql
@@ -20,12 +20,12 @@ create table
rhnContentSource
(
id number NOT NULL
- constraint rhn_ccs_id_pk primary key,
+ constraint rhn_cs_id_pk primary key,
org_id number
constraint rhn_cs_org_fk
references web_customer (id),
type_id number NOT NULL
- constraint rhn_ccs_type_fk
+ constraint rhn_cs_type_fk
references rhnContentSourceType(id),
source_url varchar2(512) NOT NULL,
label varchar2(64) NOT NULL,
diff --git
a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/001-repo-sync.sql
b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/001-repo-sync.sql
index ef7d9d7..e853e72 100644
---
a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/001-repo-sync.sql
+++
b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/001-repo-sync.sql
@@ -1,6 +1,18 @@
ALTER table rhnChannelContentSource rename to rhnContentSource;
+-- remove constraint; prepare for rhnChannelContentSource uq
+ALTER TABLE rhnContentSource
+ DROP CONSTRAINT rhn_ccs_uq;
+ALTER TABLE rhnContentSource
+ ADD CONSTRAINT rhn_cs_uq UNIQUE (id, type_id, source_url)
+ USING INDEX TABLESPACE [[4m_tbs]];
+-- rename constraints
+ALTER TABLE rhnContentSource
+ RENAME CONSTRAINT rhn_ccs_type_fk to rhn_cs_type_fk;
+ALTER TABLE rhnContentSource
+ RENAME CONSTRAINT rhn_ccs_id_pk to rhn_cs_id_pk;
+
-- create new table for mapping channels and repos
CREATE TABLE rhnChannelContentSource
(
@@ -63,4 +75,5 @@ END;
-- we don't need the channel_id column anymore since mapping table will handle it
ALTER TABLE rhnContentSource DROP (channel_id);
+-- remove last_synced since rhnChannel will now take care of this data
ALTER TABLE rhnContentSource DROP (last_synced);
Show replies by date