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.4.29 lib/inferno/utils/migration.rb
inferno_core-0.4.28 lib/inferno/utils/migration.rb
inferno_core-0.4.27 lib/inferno/utils/migration.rb
inferno_core-0.4.26 lib/inferno/utils/migration.rb
inferno_core-0.4.25 lib/inferno/utils/migration.rb
inferno_core-0.4.24 lib/inferno/utils/migration.rb
inferno_core-0.4.23 lib/inferno/utils/migration.rb
inferno_core-0.4.22 lib/inferno/utils/migration.rb
inferno_core-0.4.21 lib/inferno/utils/migration.rb
inferno_core-0.4.20 lib/inferno/utils/migration.rb
inferno_core-0.4.19 lib/inferno/utils/migration.rb
inferno_core-0.4.18 lib/inferno/utils/migration.rb
inferno_core-0.4.17 lib/inferno/utils/migration.rb
inferno_core-0.4.16 lib/inferno/utils/migration.rb
inferno_core-0.4.15 lib/inferno/utils/migration.rb
inferno_core-0.4.14 lib/inferno/utils/migration.rb
inferno_core-0.4.13 lib/inferno/utils/migration.rb
inferno_core-0.4.12 lib/inferno/utils/migration.rb
inferno_core-0.4.11 lib/inferno/utils/migration.rb
inferno_core-0.4.10 lib/inferno/utils/migration.rb