Changeset 818

Show
Ignore:
Timestamp:
04/18/08 16:06:54 (3 months ago)
Author:
seancribbs
Message:

Fix a minor bug in import_export.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extensions/import_export/lib/tasks/import_export_extension_tasks.rake

    r406 r818  
    11namespace :db do 
    22  desc "Import a database template from db/export.yml. Specify the TEMPLATE environment variable to load a different template. This is not intended for new installations, but restoration from previous exports." 
    3   task :import => :remigrate do 
     3  task :import => ["db:remigrate", "db:migrate:extensions"] do 
    44    say "ERROR: Specify a template to load with the TEMPLATE environment variable." and exit unless (ENV['TEMPLATE'] and File.exists?(ENV['TEMPLATE'])) or File.exists?("#{RADIANT_ROOT}/db/export.yml") 
    55     
     
    99     
    1010    # Load the data from the export file 
    11     data = YAML.load_file(ENV['TEMPLATE'] || "#{RADIANT_ROOT}/db/export.yml") 
     11    data = YAML.load_file(ENV['TEMPLATE'] || "#{RAILS_ROOT}/db/export.yml") 
    1212     
    1313    # Load the users first so created_by fields can be updated 
     
    4040  desc "Export a database template to db/export.yml. Specify the TEMPLATE environment variable to use a different file." 
    4141  task :export => :environment do 
    42 #    require 'exporter' 
    43     template_name = ENV['TEMPLATE'] || "#{RADIANT_ROOT}/db/export.yml" 
     42    template_name = ENV['TEMPLATE'] || "#{RAILS_ROOT}/db/export.yml" 
    4443    File.open(template_name, "w") {|f| f.write Exporter.export } 
    4544  end