demarches-normaliennes/db/migrate/20170228150522_move_inet_column_to_string.rb
2017-02-28 17:13:01 +01:00

29 lines
1.3 KiB
Ruby

class MoveInetColumnToString < ActiveRecord::Migration[5.0]
def up
change_column :users, :last_sign_in_ip, 'string'
change_column :users, :current_sign_in_ip, 'string'
change_column :gestionnaires, :last_sign_in_ip, 'string'
change_column :gestionnaires, :current_sign_in_ip, 'string'
change_column :administrateurs, :last_sign_in_ip, 'string'
change_column :administrateurs, :current_sign_in_ip, 'string'
change_column :administrations, :last_sign_in_ip, 'string'
change_column :administrations, :current_sign_in_ip, 'string'
end
def down
change_column :users, :last_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :users, :current_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :gestionnaires, :last_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :gestionnaires, :current_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :administrateurs, :last_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :administrateurs, :current_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :administrations, :last_sign_in_ip, 'inet USING last_sign_in_ip::inet'
change_column :administrations, :current_sign_in_ip, 'inet USING last_sign_in_ip::inet'
end
end