Sha256: 63be02143ffd3ee37d5b1b2b1975185021cc059a506a84f54d72e007c98ab687

Contents?: true

Size: 839 Bytes

Versions: 66

Compression:

Stored size: 839 Bytes

Contents

require 'highline/import'

namespace :gaku do
  namespace :db do

    desc "!!! Reset DB and delete migrations !!!"
    task reset: :environment do
      say "!!! Reset DB and delete migrations !!!"

      dir = "#{Rails.root}/db/migrate"
      FileUtils.rm_rf("#{dir}/.", secure: true)
      say "Migrations deleted!"

      Rake::Task["db:drop"].invoke
      say "Database dropped!"
    end

  end


  desc "Reset db + delete migrations and run generator + load sample data"
  task reset_app: :environment do
    unless Rails.env.production?
      say "rake db:drop"
      Rake::Task["db:drop"].invoke

      say "rake db:create"
      Rake::Task["db:create"].invoke

      say "rails g gaku:install"
      system('rails g gaku:install')

      #say "rake gaku:sample:load"
      #Rake::Task["gaku:sample:load"].invoke
    end
  end
end

Version data entries

66 entries across 52 versions & 4 rubygems

Version Path
gaku_frontend-0.3.0 lib/tasks/reset.rake
gaku_admin-0.3.0 lib/tasks/reset.rake
gaku_core-0.3.0 lib/tasks/reset.rake
gaku_frontend-0.3.0.pre.4 lib/tasks/reset.rake
gaku_admin-0.3.0.pre.4 lib/tasks/reset.rake
gaku_core-0.3.0.pre.4 lib/tasks/reset.rake
gaku_frontend-0.3.0.pre.3 lib/tasks/reset.rake
gaku_admin-0.3.0.pre.3 lib/tasks/reset.rake
gaku_core-0.3.0.pre.3 lib/tasks/reset.rake
gaku_frontend-0.3.0.pre.2 lib/tasks/reset.rake
gaku_admin-0.3.0.pre.2 lib/tasks/reset.rake
gaku_core-0.3.0.pre.2 lib/tasks/reset.rake
gaku_frontend-0.3.0.pre.1 lib/tasks/reset.rake
gaku_admin-0.3.0.pre.1 lib/tasks/reset.rake
gaku_core-0.3.0.pre.1 lib/tasks/reset.rake
gaku_frontend-0.3.0.pre.0 lib/tasks/reset.rake
gaku_admin-0.3.0.pre.0 lib/tasks/reset.rake
gaku_core-0.3.0.pre.0 lib/tasks/reset.rake
gaku-0.2.4 admin/lib/tasks/reset.rake
gaku-0.2.4 frontend/lib/tasks/reset.rake