Sha256: 85169c042d0c0a5ce9f248ddcddeee0c35a2d3f0f38a567c121f043395b39ff9

Contents?: true

Size: 600 Bytes

Versions: 87

Compression:

Stored size: 600 Bytes

Contents

module Inferno
  module Utils
    class Migration
      def run
        db = Inferno::Application['db.connection']
        migration_path = File.join(Inferno::Application.root, 'lib', 'inferno', 'db', 'migrations')
        Sequel::Migrator.run(db, migration_path)

        if ENV['APP_ENV'] == 'development' # rubocop:disable Style/GuardClause
          schema_path = File.join(Inferno::Application.root, 'lib', 'inferno', 'db', 'schema.rb')
          db.extension :schema_dumper
          File.open(schema_path, 'w') { |f| f.print(db.dump_schema_migration) }
        end
      end
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
inferno_core-0.6.1 lib/inferno/utils/migration.rb
inferno_core-0.6.0 lib/inferno/utils/migration.rb
inferno_core-0.5.4 lib/inferno/utils/migration.rb
inferno_core-0.5.3 lib/inferno/utils/migration.rb
inferno_core-0.5.2 lib/inferno/utils/migration.rb
inferno_core-0.5.1 lib/inferno/utils/migration.rb
inferno_core-0.5.0 lib/inferno/utils/migration.rb
inferno_core-0.4.44 lib/inferno/utils/migration.rb
inferno_core-0.4.43 lib/inferno/utils/migration.rb
inferno_core-0.4.42 lib/inferno/utils/migration.rb
inferno_core-0.4.41 lib/inferno/utils/migration.rb
inferno_core-0.4.40 lib/inferno/utils/migration.rb
inferno_core-0.4.39 lib/inferno/utils/migration.rb
inferno_core-0.4.38 lib/inferno/utils/migration.rb
inferno_core-0.4.35 lib/inferno/utils/migration.rb
inferno_core-0.4.34 lib/inferno/utils/migration.rb
inferno_core-0.4.33 lib/inferno/utils/migration.rb
inferno_core-0.4.32 lib/inferno/utils/migration.rb
inferno_core-0.4.31 lib/inferno/utils/migration.rb
inferno_core-0.4.30 lib/inferno/utils/migration.rb