Sha256: 4bf1df1a8d5479bfd3d337dc003ccf905fdb5e886d812ac3236a0de65436b1a3

Contents?: true

Size: 779 Bytes

Versions: 17

Compression:

Stored size: 779 Bytes

Contents

$: << 'lib'

require 'bundler/setup'

ENV['RACK_ENV'] = ENV['ENV'] || 'test'
require 'khronos'

def load_migrations!
  require 'khronos/storage/adapter/activerecord/migrations/schedule'
  require 'khronos/storage/adapter/activerecord/migrations/schedule_log'
end

namespace :db do

  desc 'Create the database.'
  task :create do
    adapter = Khronos::Storage::Adapter.get(ENV['KHRONOS_STORAGE'])
    if adapter.name =~ /ActiveRecord/
      load_migrations!
      CreateSchedule.up
      CreateScheduleLog.up
    end
  end

  desc 'Destroy entire database.'
  task :drop do
    adapter = Khronos::Storage::Adapter.get(ENV['KHRONOS_STORAGE'])
    if adapter.name =~ /ActiveRecord/
      load_migrations!
      CreateSchedule.down
      CreateScheduleLog.down
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
khronos-0.1.3 Rakefile
khronos-0.1.2 Rakefile
khronos-0.1.1 Rakefile
khronos-0.1.0 Rakefile
khronos-0.0.3.pre4 Rakefile
khronos-0.0.3.pre3 Rakefile
khronos-0.0.3.pre2 Rakefile
khronos-0.0.3.pre1 Rakefile
khronos-0.0.2 Rakefile
khronos-0.0.2.pre1 Rakefile
khronos-0.0.1.pre6 Rakefile
khronos-0.0.1.pre5 Rakefile
khronos-0.0.1.pre4 Rakefile
khronos-0.0.1.pre3 Rakefile
khronos-0.0.1.pre2 Rakefile
khronos-0.0.1.pre1 Rakefile
khronos-0.0.1 Rakefile