schema/spacewalk/blend | 68 ++++++++++++ schema/spacewalk/common/data/rhnException.sql | 4 schema/spacewalk/oracle/end.sql | 2 schema/spacewalk/oracle/triggers/web_user_personal_info.sql | 9 - 4 files changed, 76 insertions(+), 7 deletions(-)
New commits: commit 1c00d4e987850d3b92552419a28d085761d59f0c Author: Jeff Ortel jortel@redhat.com Date: Wed Jul 22 15:06:06 2009 -0500
Add end.sql processing; Resolve differences between databases created master and pgsql sources.
diff --git a/schema/spacewalk/blend b/schema/spacewalk/blend index d61cae9..d7f2009 100755 --- a/schema/spacewalk/blend +++ b/schema/spacewalk/blend @@ -14,6 +14,66 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+""" +Blend is a tool used to sort and combine .sql files as defined by the arguments +and the contents of the .deps files. Files with an extension of (.sql|.pkb|.pks) +are dependancy sorted as defined by the (optional) .deps files contained within each +subdirectory. The initial ordering is the natural alphabetical (directory) ordering. +The secondary ordering is based on dependancies. + +DEPENDENCY FILES (.deps) +------------------------------------------------------------------------------- + +Terms: + namespace - A root directory. + May be: (.|class|types|tables|views|procs|packages) + where (.) represents the current namesapce. + + qname - A qualified name. + May be: [namespace/]basename[.ext]. When the namespace + is not specified, the name is unqualified and resolved + using the "path". Using the extension is only necessary + when more then (1) file exists in a given namespace with + the same name but with different extensions. + +Format: + + path = {namespace}([\s,]+{namespace})* + + {qname} :: {qname}([\s,]+{qname})* + +Examples: + + path = . tables packages" + + rhnSharedChannelView :: rhnChannel procs/lookup_functions \ + rhn_channel.pks + + Assuming the current namespace (or directory) is /views. + The table dependency "rhnChannel" is unqualifed and would be searched + for in the following order: + 1st. views/rhnChannel + 2nd. tables/rhnChannel + 3rd. packages/rhnChannel + However, lookup_functions dependency is qualified by namespace so the + path will not be used. + The package header dependency "rhn_channel.pks" is unqualifed and but has + an extension and would be searched for in the following order: + 1st. views/rhn_channel.pks + 2nd. tables/rhn_channel.pks + 3rd. packages/rhn_channel.pks + +Lines may be joined by (). + +SPECIAL FILES + +start.sql - If found in the root current directory, the contents of this file is + inserted at the beginning of the output. + +end.sql - If found in the root current directory, the contents of this file is + appended to the end of the output. +""" + import sys, os, re from getopt import getopt, GetoptError
@@ -294,6 +354,7 @@ class Writer: self.start(output) for p in sorted: self.copy(p, output) + self.end(output)
def copy(self, path, output): f = open(path) @@ -316,6 +377,13 @@ class Writer: content = f.read() output.write(content) f.close() + + def end(self, output): + if os.path.exists('end.sql'): + f = open('end.sql') + content = f.read() + output.write(content) + f.close()
class Oracle(Writer): diff --git a/schema/spacewalk/common/data/rhnException.sql b/schema/spacewalk/common/data/rhnException.sql index 77c1cc9..69b12d9 100644 --- a/schema/spacewalk/common/data/rhnException.sql +++ b/schema/spacewalk/common/data/rhnException.sql @@ -42,7 +42,7 @@ insert into rhnException values (-20238, 'channel_unsubscribe_no_family','Attemp insert into rhnException values (-20239, 'arch_not_found','Architecture could not be found');
insert into rhnException values (-20240, 'channel_consent_no_license','No license agreement exists for that channel'); -insert into rhnException values (-20241, 'channel_subscribe_no_consent','Channel requires consent to license for subscription'); +insert into rhnException values (-20241, 'channel_subscrib_no_consent','Channel requires consent to license for subscription');
insert into rhnException values (-20242, 'channel_arch_not_found','Channel architecture could not be found'); insert into rhnException values (-20243, 'package_arch_not_found','Package architecture could not be found'); @@ -87,7 +87,7 @@ insert into rhnException values (-20278, 'webreg_duplicate', 'Registration numbe insert into rhnException values (-20279, 'webreg_not_active', 'Registration number is not active'); insert into rhnException values (-20280, 'webreg_sync_error', 'Error synchronizing, xxrh_oai_wrapper.sync_registration_uber'); insert into rhnException values (-20281, 'webreg_not_found', 'Registration number does not exist'); -insert into rhnException values (-20282, 'webreg_unknown_error', 'Unknown error during web registration'); +insert into rhnException values (-20282, 'webreg_unkown_error', 'Unknown error during web registration'); insert into rhnException values (-20283, 'invalid_feature', 'The specified feature does not exist'); insert into rhnException values (-20284, 'invalid_base_entitlement', 'The base entitlement is not valid for adding on other entitlements'); insert into rhnException values (-20285, 'invalid_addon_entitlement', 'The addon entitlement is not valid for adding onto other entitlements'); diff --git a/schema/spacewalk/oracle/end.sql b/schema/spacewalk/oracle/end.sql new file mode 100644 index 0000000..3a0912d --- /dev/null +++ b/schema/spacewalk/oracle/end.sql @@ -0,0 +1,2 @@ +commit; +exit diff --git a/schema/spacewalk/oracle/triggers/web_user_personal_info.sql b/schema/spacewalk/oracle/triggers/web_user_personal_info.sql index f5f4091..7e3036e 100644 --- a/schema/spacewalk/oracle/triggers/web_user_personal_info.sql +++ b/schema/spacewalk/oracle/triggers/web_user_personal_info.sql @@ -19,12 +19,11 @@
create or replace trigger web_user_pi_timestamp -before insert or update on web_user_personal_info -for each row -begin - :new.email_uc := upper(:new.email); +BEFORE INSERT OR UPDATE ON web_user_personal_info +FOR EACH ROW +BEGIN :new.modified := sysdate; -end; +END; /
show errors
spacewalk-commits@lists.fedorahosted.org