cartodb-4.42/db/migrate/20171115122200_set_default_state_to_users.rb

14 lines
281 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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
)