Class: CreatePliesAndPlyRelations

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/pliable/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/pliable/templates/migration.rb', line 2

def change
  create_table :plies do |t|
      t.integer  :user_id
      t.string   :oid
      t.string   :otype
      t.json     :data
      t.hstore   :ohash
      t.datetime :last_modified
      t.datetime :last_checked

      t.timestamps
  end

  create_table :ply_relations do |t|
    t.integer :parent_id
    t.string :parent_type
    t.integer :child_id
    t.string :child_type

    t.timestamps
  end
end