Class: CreateFionaTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/fiona/templates/create_fiona_tables.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
# File 'lib/generators/fiona/templates/create_fiona_tables.rb', line 2

def change
  create_table :templates do |t|
    t.string :type
    t.string :key
    t.string :name

    t.timestamps
  end

  create_table :template_attributes do |t|
    t.integer :template_id
    t.string  :key
    t.text    :value

    t.timestamps
  end

  add_index :template_attributes, [:template_id, :key]
end