cartodb-4.42/db/migrate/20131015154036_add_database_host_to_users.rb

18 lines
375 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
Sequel.migration do
CONFIG_DATABASE_HOST = ::SequelRails.configuration.environment_for(Rails.env)['host']
up do
add_column :users, :database_host, String
SequelRails.connection.run(%Q{
UPDATE users
SET database_host='#{CONFIG_DATABASE_HOST}'
WHERE database_host IS NULL
})
end
down do
drop_column :users, :database_host
end
end