Class: CreateVersions
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateVersions
- Defined in:
- lib/generators/active_versioning/templates/migrations/create_versions.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/active_versioning/templates/migrations/create_versions.rb', line 2 def change create_table :versions do |t| t.string :versionable_type, null: false t.integer :versionable_id, null: false t.string :event, null: false t.string :committer t.text :object t.boolean :draft, default: false t.text :commit_message t.datetime :committed_at t. null: false end add_index :versions, [:versionable_type, :versionable_id] end |