20181127130500_identity_id_to_bigint.rb 808 B

123456789101112131415161718192021222324252627
  1. require Rails.root.join('lib', 'mastodon', 'migration_helpers')
  2. class IdentityIdToBigint < ActiveRecord::Migration[5.2]
  3. include Mastodon::MigrationHelpers
  4. disable_ddl_transaction!
  5. def up
  6. safety_assured do
  7. change_column_type_concurrently :identities, :id, :bigint
  8. cleanup_concurrent_column_type_change :identities, :id
  9. change_column_type_concurrently :identities, :user_id, :bigint
  10. cleanup_concurrent_column_type_change :identities, :user_id
  11. end
  12. end
  13. def down
  14. safety_assured do
  15. change_column_type_concurrently :identities, :id, :integer
  16. cleanup_concurrent_column_type_change :identities, :id
  17. change_column_type_concurrently :identities, :user_id, :integer
  18. cleanup_concurrent_column_type_change :identities, :user_id
  19. end
  20. end
  21. end