2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/generators/acts_as_event_owner_migration/templates/acts_as_event_owner_migration.rb', line 2
def self.up
create_table :event_specifications do |t|
t.integer :owner_id
t.string :owner_type
t.string :description
t.datetime :start_at
t.datetime :end_at
t.string :repeat t.integer :frequency, :default => 1 t.string :on t.string :on_the t.string :target t.datetime :until
t.timestamps
end
add_index :event_specifications, [:owner_id, :owner_type]
create_table :event_occurrences do |t|
t.integer :owner_id
t.string :owner_type
t.integer :event_specification_id
t.datetime :start_at
t.datetime :end_at
t.string :description
t.timestamps
end
add_index :event_occurrences, [:owner_id, :owner_type]
add_index :event_occurrences, :event_specification_id
end
|