cartodb-4.42/db/migrate/20190517120000_drop_salt.rb
2024-04-06 05:25:13 +00:00

16 lines
441 B
Ruby

require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
run "UPDATE users SET crypted_password = concat('$sha$v=1$$',salt,'$',crypted_password) WHERE salt <> ''"
drop_column :users, :salt
drop_column :user_creations, :salt
end,
Proc.new do
add_column :users, :salt, String, null: false, default: ""
add_column :user_creations, :salt, String, null: false, default: ""
end
)