radiant / radiant

Radiant is a no-fluff, open source content management system designed for small teams.

commit  f909ad100c6d6d17882db112df442c59607bf5b4
tree    b1dcaa6e006b3b64d23ea1610474a28340b0bab6
parent  cab11d9d6a57f25893db57823bc0acba0bf03b53
radiant / lib / tasks / database.rake
80781acd » seancribbs 2008-06-20 Import from old repository. 1 namespace :db do
2 desc "Migrate schema to version 0 and back up again. WARNING: Destroys all data in tables!!"
3 task :remigrate => :environment do
4 require 'highline/import'
5 if ENV['OVERWRITE'].to_s.downcase == 'true' or agree("This task will destroy any data in the database. Are you sure you want to \ncontinue? [yn] ")
6
7 # Migrate downward
8 ActiveRecord::Migrator.migrate("#{RADIANT_ROOT}/db/migrate/", 0)
9
10 # Migrate upward
11 Rake::Task["db:migrate"].invoke
12
13 # Dump the schema
14 Rake::Task["db:schema:dump"].invoke
15 else
16 say "Task cancelled."
17 exit
18 end
19 end
20
21 desc "Bootstrap your database for Radiant."
22 task :bootstrap => :remigrate do
23 require 'radiant/setup'
24 Radiant::Setup.bootstrap(
25 :admin_name => ENV['ADMIN_NAME'],
26 :admin_username => ENV['ADMIN_USERNAME'],
27 :admin_password => ENV['ADMIN_PASSWORD'],
28 :database_template => ENV['DATABASE_TEMPLATE']
29 )
30 end
31 end