You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
808 B

  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