20181127130500_identity_id_to_bigint.rb 839 B

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