<分区>
给定这段代码:
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.string :commenter
t.text :body
t.references :article, index: true
t.timestamps
end
end
end
我知道 CreateComments 继承了 Migration 的方法。但是什么是 Migration to ActiveRecord?与其他语言相比,我在 ActiveRecord 类中找不到任何名为 Migration 的成员。那么 ::
是什么意思呢?在这种情况下,您将迁移称为什么?