If you go here:

spacewalk/schema/spacewalk/rhnsat/tables

you will see a file called:

Makefile.deps

For those of you making schema changes you need to be aware of this file. This is how we control the order of the sql that gets run when we create our schema in Spacewalk.

Ever wondered how the SQL knew to create web_concact before it creates rhnServer (rhnServer references web_contact in a fk)?

Well, if you take a peek at Makefile.deps you will see how it works. Just add the dependency path next to the tables you add.

While trying to get the multiorg and cobbler table additions to run from scratch I noticed things weren't ordered correctly when they were getting created. I added a few entries to the Makefiles.deps file:

--- a/schema/spacewalk/rhnsat/tables/Makefile.deps
+++ b/schema/spacewalk/rhnsat/tables/Makefile.deps
@@ -67,6 +67,8 @@ rhnChannelPackageArchCompat_data :: lookup_functions rhnChannelArch_data \
 rhnChannelPermission   :: rhnChannelPermissionRole rhnChannel web_contact
 rhnChannelRelationship :: rhnRelationshipType rhnChannel
+rhnChannelTrust         :: rhnChannel
+rhnChannel_triggers     :: rhnChannelTrust
 rhnClientCapability     :: rhnClientCapabilityName
 rhnClientOptionVersionMap :: rhnClientConfigOption rhnPackageEVR

you need to have rhnChannelTrust created *after* rhnChannel and likewise, the rhnChannel triggers need to get created after the tables are setup.

just a heads up!

--
Mike McCune
mmccune AT redhat.com
Engineering               | Portland, OR
RHN Satellite             | 650.567.9039x79248

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to