sometimes I should read documentation carefully ;-)
from the FAQ:
<FAQ>
How do I manage CE’s migrations? To migrate your application to CE’s
latest version, use:
script/generate plugin_migration
If there are new CE migrations that you haven’t applied yet, CE will
warn you when you start your server, or run tests.
</FAQ>
sorry for producing much ado about nothing
On 26 Sep., 11:46, Fritzek <[EMAIL PROTECTED]> wrote:
> Bruno
>
> is the above code necessary? Or should I do a script/generate
> plugin_migration anyway with each deploy? Or deploy:migrations?
>
> Fritzek
>
> PS: if not necessary the above code was a good training for scripting
> within capistrano ;-)
>
> On Sep 26, 10:30 am, Fritzek <[EMAIL PROTECTED]> wrote:
>
> > solved my problems. here the working version (sorry, tried to pastie
> > again, but they have server problems):
>
> > <code>
> > # if you've found the pastie 279826 -> the old version, take this, its
> > newer and works ;-) delete this line before copy and paste
> > logger.info "Generate Script for checking for new CommunityEngine
> > migrations"
> > script = <<-SCRIPT
> > puts "Check now for new plugin migrations"\n
> > last_version = Dir["#{release_path}/db/migrate/
> > [0-9]*_community_engine_*.rb"].sort.last\n
> > if last_version\n
> > current_ce_version =
> > last_version[/.*_community_engine_to_version_(\\d+)/, 1].to_i\n
> > else\n
> > current_ce_version = 0\n
> > end\n
> > migrations = Dir["#{release_path}/vendor/plugins/community_engine/db/
> > migrate/*.rb"]\n
> > if migrations.empty?\n
> > newest_ce_migration = 0\n
> > else \n
> > newest_ce_migration = migrations.map { |p|
> > File.basename(p) }.sort.last.match(/0*(\\d+)\\_/)[1].to_i\n
> > end\n
> > pending = newest_ce_migration - current_ce_version\n
> > if pending > 0\n
> > system "#{release_path}/script/generate plugin_migration"\n
> > puts "---"\n
> > puts "We have done the 'script/generate plugin_migration'."\n
> > puts "---"\n
> > end\n\004\n
> > SCRIPT
>
> > run "ruby", :data => script
> > </code>
>
> > On Sep 26, 9:05 am, Fritzek <[EMAIL PROTECTED]> wrote:
>
> > > Hi folks
>
> > > see this pastiehttp://pastie.org/279826forasnippet of my deploy.rb
> > > which checks your current migrations and newest coming with CE. It
> > > will do the script/generate plugin_migration so the next cap
> > > deploy:migrations with install them.
>
> > > I have still some problems with this. So if you're interested have a
> > > look, use it and if you find a solution please let me know.
>
> > > reagrds, Fritzek
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---