cartodb-4.29/db/migrate/20171115122200_set_default_state_to_users.rb
2020-06-15 10:58:47 +08:00

14 lines
281 B
Ruby

require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
set_column_default :users, :state, 'active'
run "UPDATE users SET state = 'active';"
end,
Proc.new do
run 'ALTER TABLE users ALTER COLUMN state DROP DEFAULT;'
end
)