Sha256: 4bfb4ba54ea2565c127f6765e18b4755b6086732b598abe6dd5823e834d96bd8
Contents?: true
Size: 545 Bytes
Versions: 8
Compression:
Stored size: 545 Bytes
Contents
class MoveDatabaseName < Sequel::Migration def up [:resources, :resources_versions].each do |name| alter_table(name) { add_column(:database_name, String) } end self[:connections].each do |connection| [:resources, :resources_versions].each do |name| self[name].filter(:connection_id => connection[:id]).update(:database_name => connection[:database_name]) end end alter_table(:connections) { drop_column(:database_name) } end def down raise "This migration is not reversible." end end
Version data entries
8 entries across 8 versions & 1 rubygems