I''m adding tables to the storeconfigs database, to support my storereports plugin, and would like some guidance on handling the schema version. First prize would see my database extensions applied as migrations. But then ActiveRecord would want to bump the schema version. Any ideas on how to handle this gracefully so that I don''t confuse the hell out of puppet itself, on upgrade? Thanks, Sheldon. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
why not just create a new schema and have 1 to 1 relationships with tables (if you are extending tables). --- Thanks, Allan Marcus 505-667-5666 On Jul 2, 2009, at 2:08 AM, Sheldon Hearn wrote:> > I''m adding tables to the storeconfigs database, to support my > storereports plugin, and would like some guidance on handling the > schema version. > > First prize would see my database extensions applied as migrations. > But then ActiveRecord would want to bump the schema version. > > Any ideas on how to handle this gracefully so that I don''t confuse the > hell out of puppet itself, on upgrade? > > Thanks, > Sheldon. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Sheldon Hearn
2009-Jul-03 08:10 UTC
[Puppet Users] Re: Extending the storeconfigs database
I''m not sure I understand. Do you mean create a new database? Ciao, Sheldon. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
yes, create a new database. Let''s called it "puppet_extra" Let say the StoreConfigs db has a table called "hosts" that you want to add columns to. Create a table in puppet_extra called "hosts" with two fields: ID and myExtraColumn. Assuming you have some sort of code that inserts the extra data, just add the extra to the puppet_extra.hosts table. If there is not entry there, then add one using the same ID as the hosts entry in the puppet db. One thing you will need to be careful of is when you do selects from the two tables. Normally you would do a join between puppet.hosts.id and puppet_extra.hosts.id, but it''s possible that there is not entry in puppet_extra.hosts for every enter in puppet.hosts (unless you ensure there is). If there is not, then you need to do a left join to make sure you get all the rows in puppet.hosts. If this doesn''t make sense, find a database person to help. --- Thanks, Allan Marcus 505-667-5666 On Jul 3, 2009, at 2:10 AM, Sheldon Hearn wrote:> > I''m not sure I understand. Do you mean create a new database? > > Ciao, > Sheldon. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---