Sha256: 1f3b6cad90f644a967e527866a510b20e2da93fc26364361e60edc54438de427

Contents?: true

Size: 1.3 KB

Versions: 18

Compression:

Stored size: 1.3 KB

Contents

namespace :thecore do
    namespace :db do
        desc "Load seeds from thecore engines seed files, it also runs rails db:seed as last action."
        task seed: :environment do
            Rails::Engine.subclasses.each { |engine| engine.send :load_seed }
            Rake::Task["db:seed"].reenable
            Rake::Task["db:seed"].invoke
        end
        desc "Creates DB if not exists, then init it with all Thecore compatible seeds."
        task init: :environment do
            Rake::Task["db:create"].reenable
            Rake::Task["db:create"].invoke
            Rake::Task["db:migrate"].reenable
            Rake::Task["db:migrate"].invoke
            Rake::Task["thecore:db:seed"].reenable
            Rake::Task["thecore:db:seed"].invoke
        end
        desc "Keeps the DB updated by applying latest migrations and data seeding."
        task update: :environment do
            Rake::Task["thecore:db:init"].reenable
            Rake::Task["thecore:db:init"].invoke
        end
        desc "Deletes DB if not exists, then init it with all Thecore compatible seeds."
        task reset: :environment do
            Rake::Task["db:drop"].reenable
            Rake::Task["db:drop"].invoke
            Rake::Task["thecore:db:init"].reenable
            Rake::Task["thecore:db:init"].invoke
        end
    end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
thecore_auth_commons-3.2.2 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.2.1 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.7 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.5 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.4 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.3 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.2 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.1 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.1.0 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.13 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.12 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.11 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.10 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.9 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.8 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.7 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.6 lib/tasks/thecore_auth_commons_tasks.rake
thecore_auth_commons-3.0.5 lib/tasks/thecore_auth_commons_tasks.rake