We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This seems to be unsupported now and in any case its not strictly mandatory to explicitly define column position using after:.
after:
friendly_id-mobility/lib/generators/templates/migration.rb
Line 3 in 4539245
Without specifying the position, the new column will be added at the end of the table by default. which is always after :scope
:scope
Suggestion: simply leaving it out of the generator template. i tested it and it works well without. see: #36
Error Details:
Ruby: 3.3.0 Rails: 7.1.3 Database adapter: postgresql
3.3.0
7.1.3
postgresql
Unknown key: :after. Valid keys are: :limit, :precision, :scale, :default, :null, :collation, :comment, :primary_key, :if_exists, :if_not_exists, :array, :using, :cast_as, :as, :type, :enum_type, :stored
Trace:
** Execute db:migrate == 20240217161147 AddLocaleToFriendlyIdSlugs: migrating ======================= -- add_column(:friendly_id_slugs, :locale, :string, {:null=>false}) -> 0.0027s -- change_table(:friendly_id_slugs) bin/rails aborted! StandardError: An error has occurred, this and all later migrations canceled: (StandardError) Unknown key: :after. Valid keys are: :limit, :precision, :scale, :default, :null, :collation, :comment, :primary_key, :if_exists, :if_not_exists, :array, :using, :cast_as, :as, :type, :enum_type, :stored /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3/lib/active_support/core_ext/hash/keys.rb:52:in `block in assert_valid_keys' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3/lib/active_support/core_ext/hash/keys.rb:50:in `each_key' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3/lib/active_support/core_ext/hash/keys.rb:50:in `assert_valid_keys' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/abstract/schema_definitions.rb:592:in `create_column_definition' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/abstract/schema_definitions.rb:569:in `new_column_definition' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/postgresql/schema_definitions.rb:275:in `new_column_definition' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:426:in `build_change_column_definition' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1003:in `change_column_for_alter' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:414:in `change_column' /Users/khalil/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3/lib/active_record/connection_adapters/abstract/schema_definitions.rb:790:in `change' /Users/khalil/code/Furno/furno/db/migrate/20240217161147_add_locale_to_friendly_id_slugs.rb:5:in `block in change'
The text was updated successfully, but these errors were encountered:
Remove unsupported/explicit after: :scope fix shioyama#35
61a0940
Successfully merging a pull request may close this issue.
This seems to be unsupported now and in any case its not strictly mandatory to explicitly define column position using
after:
.friendly_id-mobility/lib/generators/templates/migration.rb
Line 3 in 4539245
Without specifying the position, the new column will be added at the end of the table by default. which is always after
:scope
Suggestion: simply leaving it out of the generator template. i tested it and it works well without. see: #36
Error Details:
Ruby:
3.3.0
Rails:
7.1.3
Database adapter:
postgresql
Trace:
The text was updated successfully, but these errors were encountered: