java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 4 +--
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 12 +++++-----
schema/spacewalk/common/tables/rhnPackageRepoData.sql | 2 -
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPackageRepodata.sql | 1
4 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit 32cb295c53f84535e1fa18c7393ee40190eb6f01
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Sun Jun 20 21:58:06 2010 -0400
updating rhnPackageRepodata table to not use a reserved word.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index 3a00d2f..57fd4bc 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -1882,7 +1882,7 @@ ORDER BY P.package_arch_id DESC
<write-mode name="insert_primary_xml">
<query params="pid, xml">
update rhnPackageRepodata
- set primary = :xml
+ set primary_xml = :xml
where package_id = :pid
</query>
</write-mode>
@@ -1916,7 +1916,7 @@ ORDER BY P.package_arch_id DESC
<mode name="lookup_repodata" class="com.redhat.rhn.frontend.dto.PackageDto">
<query params="pid">
SELECT
- P.package_id AS id, p.primary as primary_xml, p.other as other_xml, p.filelist as filelist_xml
+ P.package_id AS id, p.primary_xml as primary_xml, p.other as other_xml, p.filelist as filelist_xml
from rhnPackageRepoData p
where p.package_id = :pid
</query>
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index 2638cee..9b7b061 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -561,7 +561,7 @@ FROM
p.copyright, p.vendor, p.build_host, p.header_start, p.header_end,
srpm.name as source_rpm, pg.name as package_group_name,
cs.checksum, cs.checksum_type as checksum_type,
- prd.primary as primary_xml, prd.filelist as filelist_xml, prd.other as other_xml
+ prd.primary_xml as primary_xml, prd.filelist as filelist_xml, prd.other as other_xml
FROM
rhnChannelPackage cp,
rhnPackage p
@@ -592,7 +592,7 @@ FROM
chpkg.package_id = pkgf.package_id
AND pkgf.capability_id = pkgcap.id
AND chpkg.channel_id = :channel_id
- AND prd.primary is null
+ AND prd.primary_xml is null
ORDER BY pkgf.package_id
</query>
</mode>
@@ -606,7 +606,7 @@ FROM
chpkg.package_id = pkgp.package_id
AND pkgp.capability_id = pkgcap.id
AND chpkg.channel_id = :channel_id
- AND prd.primary is null
+ AND prd.primary_xml is null
ORDER BY pkgp.package_id
</query>
</mode>
@@ -620,7 +620,7 @@ FROM
chpkg.package_id = pkgp.package_id
AND pkgp.capability_id = pkgcap.id
AND chpkg.channel_id = :channel_id
- AND prd.primary is null
+ AND prd.primary_xml is null
ORDER BY pkgp.package_id
</query>
</mode>
@@ -634,7 +634,7 @@ FROM
chpkg.package_id = pkgp.package_id
AND pkgp.capability_id = pkgcap.id
AND chpkg.channel_id = :channel_id
- AND prd.primary is null
+ AND prd.primary_xml is null
ORDER BY pkgp.package_id
</query>
</mode>
@@ -648,7 +648,7 @@ FROM
chpkg.package_id = pkgp.package_id
AND pkgp.capability_id = pkgcap.id
AND chpkg.channel_id = :channel_id
- AND prd.primary is null
+ AND prd.primary_xml is null
ORDER BY pkgp.package_id
</query>
</mode>
diff --git a/schema/spacewalk/common/tables/rhnPackageRepoData.sql b/schema/spacewalk/common/tables/rhnPackageRepoData.sql
index 4f662c4..1241e99 100644
--- a/schema/spacewalk/common/tables/rhnPackageRepoData.sql
+++ b/schema/spacewalk/common/tables/rhnPackageRepoData.sql
@@ -22,7 +22,7 @@ CREATE TABLE rhnPackageRepodata
CONSTRAINT rhn_pkey_rd_pid_fk
REFERENCES rhnPackage (id)
ON DELETE CASCADE,
- primary BLOB,
+ primary_xml BLOB, -- primary is a reserved word :{
filelist BLOB,
other BLOB,
created DATE
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPackageRepodata.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPackageRepodata.sql
new file mode 100644
index 0000000..67c6981
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/003-rhnPackageRepodata.sql
@@ -0,0 +1 @@
+alter table rhnPackageRepodata rename column primary to primary_xml;