cirandas.net

ref: master

plugins/volunteers/db/migrate/20141012005319_create_volunteers_plugin_periods.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
class CreateVolunteersPluginPeriods < ActiveRecord::Migration
  def up
    create_table :volunteers_plugin_periods do |t|
      t.integer :owner_id
      t.string :owner_type
      t.text :name
      t.datetime :start
      t.datetime :end
      t.integer :minimum_assigments
      t.integer :maximum_assigments

      t.timestamps
    end
    add_index :volunteers_plugin_periods, [:owner_type]
    add_index :volunteers_plugin_periods, [:owner_id, :owner_type]
  end

  def down
    drop_table :volunteers_plugin_periods
  end
end