Class: SchedularMigrations

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
generators/schedular_migrations/templates/schedular_migrations.rb

Class Method Summary collapse

Class Method Details

.downObject



23
24
25
26
27
# File 'generators/schedular_migrations/templates/schedular_migrations.rb', line 23

def self.down
  drop_table :schedular_events
  drop_table :schedular_times
  drop_table :schedular_events_times
end

.upObject



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

def self.up
  create_table :schedular_events do |t|
    t.string   :name
    t.string   :dates
    t.text     :description
    t.timestamps
  end
  
  create_table :schedular_times do |t|
    t.datetime :value
    t.boolean  :all_day
    t.integer  :duration
    t.timestamps
  end
  
  create_table :schedular_events_times, :id => false do |t|
    t.integer  :time_id
    t.integer  :event_id
  end
end