cartodb-4.42/db/migrate/20171115122200_set_default_state_to_users.rb
2024-04-06 05:25:13 +00: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
)