Commit 0725f74d54984d10514911602276c4401f54cae4
1 parent
1a167fcf
Exists in
master
and in
25 other branches
restoring the migration that creates chat_messages
fixes the error pointed by Daniela Feitosa: https://gitlab.com/noosfero/noosfero/commit/1c125da767ba502b800bd58896ed1aaac828a092#note_1316719
Showing
3 changed files
with
38 additions
and
20 deletions
Show diff stats
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +class CreateChatMessages < ActiveRecord::Migration | ||
2 | + def up | ||
3 | + create_table :chat_messages do |t| | ||
4 | + t.integer :to_id | ||
5 | + t.integer :from_id | ||
6 | + t.string :body | ||
7 | + | ||
8 | + t.timestamps | ||
9 | + end | ||
10 | + end | ||
11 | + | ||
12 | + def down | ||
13 | + drop_table :chat_messages | ||
14 | + end | ||
15 | +end |
db/migrate/20141014205254_change_chat_messages_columns_and_add_indexes.rb
0 → 100644
@@ -0,0 +1,23 @@ | @@ -0,0 +1,23 @@ | ||
1 | +class ChangeChatMessagesColumnsAndAddIndexes < ActiveRecord::Migration | ||
2 | + def up | ||
3 | + change_table :chat_messages do |t| | ||
4 | + t.change :from_id, :integer, :null => false | ||
5 | + t.change :to_id, :integer, :null => false | ||
6 | + t.change :body, :text | ||
7 | + end | ||
8 | + add_index :chat_messages, :from_id | ||
9 | + add_index :chat_messages, :to_id | ||
10 | + add_index :chat_messages, :created_at | ||
11 | + end | ||
12 | + | ||
13 | + def down | ||
14 | + remove_index :chat_messages, :from_id | ||
15 | + remove_index :chat_messages, :to_id | ||
16 | + remove_index :chat_messages, :created_at | ||
17 | + change_table :chat_messages do |t| | ||
18 | + t.change :from_id, :integer, :null => true | ||
19 | + t.change :to_id, :integer, :null => true | ||
20 | + t.change :body, :string | ||
21 | + end | ||
22 | + end | ||
23 | +end |
db/migrate/20141014205254_create_chat_messages.rb
@@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
1 | -class CreateChatMessages < ActiveRecord::Migration | ||
2 | - def up | ||
3 | - create_table :chat_messages do |t| | ||
4 | - t.references :from, :null => false | ||
5 | - t.references :to, :null => false | ||
6 | - t.text :body | ||
7 | - t.timestamps | ||
8 | - end | ||
9 | - add_index :chat_messages, :from_id | ||
10 | - add_index :chat_messages, :to_id | ||
11 | - add_index :chat_messages, :created_at | ||
12 | - end | ||
13 | - | ||
14 | - def down | ||
15 | - remove_index :chat_messages, :from_id | ||
16 | - remove_index :chat_messages, :to_id | ||
17 | - remove_index :chat_messages, :created_at | ||
18 | - drop_table :chat_messages | ||
19 | - end | ||
20 | -end |