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
Hey! I'd like to suggest a single-file migration with some indexes removed because of recommendations from active_record_doctor
active_record_doctor
class AddActsAsTaggableOn < ActiveRecord::Migration[7.1] def change create_table :tags, id: :uuid do |t| t.string "name" t.integer "taggings_count", default: 0 t.timestamps end add_index :tags, :name, unique: true create_table :taggings, id: :uuid do |t| t.references :tag, foreign_key: {to_table: :tags}, type: :uuid t.references :taggable, polymorphic: true, type: :uuid t.references :tagger, polymorphic: true, type: :uuid t.string "context", limit: 128 t.string "tenant", limit: 128 t.timestamps end add_index :taggings, %i[taggable_id taggable_type context], name: "taggings_taggable_context_idx" add_index :taggings, :tagger_id add_index :taggings, :context add_index :taggings, %i[taggable_id taggable_type tagger_id context], name: "taggings_idy" add_index :taggings, :tenant end end
Also, I've added uuid because I use it for indexes in PostgreSQL.
From my point of view it looks cleaner and easy to read/support.
If it is ok - I'll create PR
The text was updated successfully, but these errors were encountered:
Let do it
Sorry, something went wrong.
No branches or pull requests
Hey!
I'd like to suggest a single-file migration with some indexes removed because of recommendations from
active_record_doctor
Also, I've added uuid because I use it for indexes in PostgreSQL.
From my point of view it looks cleaner and easy to read/support.
If it is ok - I'll create PR
The text was updated successfully, but these errors were encountered: