Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relation "custom_filters" does not exist #8007

Closed
2 tasks done
progval opened this issue Jul 12, 2018 · 9 comments
Closed
2 tasks done

Relation "custom_filters" does not exist #8007

progval opened this issue Jul 12, 2018 · 9 comments

Comments

@progval
Copy link
Contributor

progval commented Jul 12, 2018

While running db:migrate for v2.4.3, I'm getting this error:

Migrating to FixAccountsUniqueIndex (20180528141303)
== 20180528141303 FixAccountsUniqueIndex: migrating ===========================
-- 
-- WARNING: This migration may take a *long* time for large instances
-- It will *not* lock tables for any significant time, but it may run
-- for a very long time. We will pause for 10 seconds to allow you to
-- interrupt this migration if you are not ready.
-- 
-- This migration will irreversibly delete user accounts with duplicate
-- usernames. You may use the `rake mastodon:maintenance:find_duplicate_usernames`
-- task to manually deal with such accounts before running this migration.
   -> Continuing in 10 seconds...
   -> Continuing in 9 seconds...
   -> Continuing in 8 seconds...
   -> Continuing in 7 seconds...
   -> Continuing in 6 seconds...
   -> Continuing in 5 seconds...
   -> Continuing in 4 seconds...
   -> Continuing in 3 seconds...
   -> Continuing in 2 seconds...
   -> Continuing in 1 second...
-- Deduplicating @krita@mastodon.art (1 duplicates)...
Scoped order is ignored, it's forced to be batch order.
Creating scope :cache_ids. Overwriting existing method Notification.cache_ids.
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

PG::UndefinedTable: ERREUR:  la relation « custom_filters » n'existe pas
LINE 8:                WHERE a.attrelid = '"custom_filters"'::regcla...
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                     c.collname, col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a
                LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                LEFT JOIN pg_type t ON a.atttypid = t.oid
                LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
               WHERE a.attrelid = '"custom_filters"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in `async_exec'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in `block (2 levels) in query'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:62:in `block in query'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `query'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:749:in `column_definitions'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:113:in `columns'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/schema_cache.rb:69:in `columns'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/schema_cache.rb:75:in `columns_hash'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:466:in `load_schema!'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/attributes.rb:234:in `load_schema!'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/attribute_decorators.rb:51:in `load_schema!'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:459:in `block in load_schema'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:456:in `load_schema'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:346:in `attribute_types'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:370:in `type_for_attribute'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/table_metadata.rb:33:in `type'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:55:in `build_bind_attribute'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder/basic_object_handler.rb:11:in `call'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:51:in `build'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:106:in `block in expand_from_hash'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:66:in `each'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:66:in `flat_map'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:66:in `expand_from_hash'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/predicate_builder.rb:21:in `build_from_hash'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/where_clause_factory.rb:19:in `build'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/relation/query_methods.rb:591:in `where!'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association_scope.rb:156:in `apply_scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association_scope.rb:67:in `last_chain_scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association_scope.rb:124:in `add_constraints'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association_scope.rb:29:in `scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association_scope.rb:7:in `scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association.rb:91:in `association_scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/association.rb:80:in `scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:288:in `scope'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:306:in `find_target'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:273:in `load_target'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/has_many_association.rb:27:in `handle_dependency'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/associations/builder/association.rb:137:in `block in add_destroy_callbacks'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:426:in `instance_exec'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:605:in `catch'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:605:in `block in default_terminator'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:199:in `block in halting'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:513:in `each'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:513:in `invoke_before'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:131:in `run_callbacks'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:816:in `_run_destroy_callbacks'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:323:in `destroy'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:305:in `block in destroy'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in `block in with_transaction_returning_status'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in `block in within_new_transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in `within_new_transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in `transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in `with_transaction_returning_status'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:305:in `destroy'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:56:in `block (2 levels) in deduplicate_account!'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:43:in `each'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:43:in `block in deduplicate_account!'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:840:in `block in say_with_time'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:840:in `say_with_time'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:42:in `deduplicate_account!'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:23:in `block in up'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:22:in `each'
/home/mastodon-code/mastodon/db/migrate/20180528141303_fix_accounts_unique_index.rb:22:in `up'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:817:in `exec_migration'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:797:in `block in migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:796:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/strong_migrations-0.2.2/lib/strong_migrations/migration.rb:13:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `block in migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/strategy.rb:70:in `wrap'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy.rb:201:in `strategy'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:977:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1345:in `ddl_transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1262:in `each'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1210:in `block in migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1210:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `block in migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/strategy.rb:70:in `wrap'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy.rb:201:in `strategy'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1036:in `up'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:1011:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/strong_migrations-0.2.2/lib/strong_migrations/database_tasks.rb:4:in `migrate'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/command.rb:48:in `invoke'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<top (required)>'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/home/mastodon-code/mastodon/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
bin/rails:4:in `<main>'

  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
@progval
Copy link
Contributor Author

progval commented Jul 12, 2018

Workaround: mv db/migrate/20180628181026_create_custom_filters.rb db/migrate/20180528141302_create_custom_filters.rb

@hugogameiro
Copy link
Contributor

For me the fix was to first upgrade to v2.4.1 and then from v2.4.1 to v2.4.3

@ClearlyClaire
Copy link
Contributor

Yeah, the migration scripts use the Account model directly, but it has changed over time, depending on new tables and database fields. It would be nice to have more robust migration scripts, but anyway, it's recommended to upgrade release after release, as the migrations have been tested this way.

@joachimesque
Copy link

I was having the same problem (updating from v2.4.0 to v2.4.3), and @progval's solution worked for me. Thanks !

@ashfurrow
Copy link
Contributor

I was having this problem too but @progval's workaround did the trick 👍 One note, if you're on Docker like I am, you have to run the mv command and then re-build the Docker images, but then it'll work.

mv db/migrate/20180628181026_create_custom_filters.rb db/migrate/20180528141302_create_custom_filters.rb
docker-compose build
docker-compose run --rm web rails db:migrate

Thanks again @progval !

ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this issue Aug 11, 2018
Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
ClearlyClaire added a commit to glitch-soc/mastodon that referenced this issue Aug 13, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
nolanlawson pushed a commit to nolanlawson/mastodon that referenced this issue Aug 15, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
@nolanlawson
Copy link
Contributor

Does the mv workaround have any long-term effects? I tried it and the migration succeeded, but I'm worried it will cause issues later on.

OTOH I tried cherry-picking the "official" fix instead (cbc2e6b) and the migration failed:

undefined method `acct' for #<FixAccountsUniqueIndex::Account:0x0000562b622fce28>

@ckolderup
Copy link

@nolanlawson once the migrations have run, they don't run again as long as you have your database (ActiveRecord keeps a table of which migrations it's run before), so those files are essentially just ignored for your instance from here on out.

@ClearlyClaire
Copy link
Contributor

ClearlyClaire commented Aug 15, 2018

@nolanlawson no, there shouldn't be any downside to it.
I'm sorry I overlooked acct in the migration script fix (#8212 should fix it).

@nolanlawson
Copy link
Contributor

Awesome, thanks @ThibG! I can confirm that with this added commit, the upgrade from 2.3.3 to 2.4.3 went smoothly.

So for anyone trying to upgrade from 2.3.3 to 2.4.3, these are the commits you'll need to cherry-pick: 7a68608 cbc2e6b 4f24dc3

nolanlawson pushed a commit to nolanlawson/mastodon that referenced this issue Aug 16, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
nolanlawson pushed a commit to tootcafe/mastodon that referenced this issue Aug 16, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
nolanlawson pushed a commit to nolanlawson/mastodon that referenced this issue Aug 19, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
Gargron pushed a commit that referenced this issue Aug 24, 2018
Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
kedamaDQ pushed a commit to kedamaDQ/mastodon that referenced this issue Aug 25, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
kyori19 pushed a commit to kyori19/mastodon that referenced this issue Sep 20, 2018
…n#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
koba-lab added a commit to koba-lab/mastodon that referenced this issue Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants