Sha256: f04c540def98ca616772d6bd54cc00c15818c0dd5ff1dea57baed33e79ec2f51

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

namespace 'db' do

  kit = Kit.new 'config.yml'

  desc %q{Create the kit's database}
  task :create do
    kit.db_create
  end

  desc %q{Destroy the kit's database}
  task :destroy do
    kit.db_destroy
  end

  desc %q{Reset the kit's database to an empty state and run all migrations}
  task :reset => [:destroy, :create, :migrate] do
  end

  task :environment do
    kit.db_connect
  end

  desc %q{Fully migrate the kit's database: optionally specify the direction and how many steps (1 by default)}
  task :migrate, [:direction, :steps]  => [:create, :environment] do |_, args|
    args.with_defaults(direction: nil, steps: 1)
    if args[:direction].nil?
      kit.db_migrate
    else
      kit.db_migrate args[:direction], args[:steps]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kit-1.2.0 lib/kit/rake/admin/database.rb