diaspora/db/migrate/20140801101352_create_chat_fragments.rb
Lukas Matt 56e882879a Add chat migration
* add chat_contacts table
* add chat_fragments table
* add chat_enabled column to aspects
* add chat_offline_messages table
2014-11-13 11:14:54 +01:00

17 lines
527 B
Ruby

class CreateChatFragments < ActiveRecord::Migration
def up
create_table :chat_fragments do |t|
t.integer :user_id, null: false
t.string :root, limit: 256, null: false
t.string :namespace, limit: 256, null: false
t.text :xml, null: false
end
# That'll wont work due UTF-8 and the limit of 767 bytes
#add_index :chat_fragments, [:user_id, :root, :namespace], unique: true
add_index :chat_fragments, [:user_id], unique: true
end
def down
drop_table :chat_fragments
end
end