2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/generators/user_announcements/templates/migration.rb', line 2
def change
create_table :announcements do |t|
t.text :message
t.datetime :starts_at
t.datetime :ends_at
t.boolean :active
t.text :roles
t.text :types
t.text :style
t.timestamps
end
create_table :hidden_announcements, :force => true do |t|
t.integer :user_id
t.integer :announcement_id
t.timestamps
end
add_index :hidden_announcements, :user_id
add_index :hidden_announcements, :announcement_id
end
|