programandoarg/pg_rails

View on GitHub
pg_engine/db/migrate/20240210025702_create_active_admin_comments.rb

Summary

Maintainability
A
0 mins
Test Coverage
class CreateActiveAdminComments < ActiveRecord::Migration[7.1]
  def self.up
    create_table :active_admin_comments do |t|
      t.string :namespace
      t.text   :body
      t.references :resource, polymorphic: true
      t.references :author, polymorphic: true
      t.timestamps
    end
    add_index :active_admin_comments, [:namespace]
  end

  def self.down
    drop_table :active_admin_comments
  end
end