diff --git a/db/migrate/20140801101230_create_chat_contacts.rb b/db/migrate/20140801101230_create_chat_contacts.rb new file mode 100644 index 000000000..346ad9c20 --- /dev/null +++ b/db/migrate/20140801101230_create_chat_contacts.rb @@ -0,0 +1,16 @@ +class CreateChatContacts < ActiveRecord::Migration + def up + create_table :chat_contacts do |t| + t.integer :user_id, null: false + t.string :jid, null: false + t.string :name, limit: 255, null: true + t.string :ask, limit: 128, null: true + t.string :subscription, limit: 128, null: false + end + add_index :chat_contacts, [:user_id, :jid], unique: true + end + + def down + drop_table :chat_contacts + end +end diff --git a/db/migrate/20140801101352_create_chat_fragments.rb b/db/migrate/20140801101352_create_chat_fragments.rb new file mode 100644 index 000000000..afa64ce6f --- /dev/null +++ b/db/migrate/20140801101352_create_chat_fragments.rb @@ -0,0 +1,17 @@ +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 diff --git a/db/migrate/20141007003922_add_chat_enabled_to_aspects.rb b/db/migrate/20141007003922_add_chat_enabled_to_aspects.rb new file mode 100644 index 000000000..ba4fd31fc --- /dev/null +++ b/db/migrate/20141007003922_add_chat_enabled_to_aspects.rb @@ -0,0 +1,9 @@ +class AddChatEnabledToAspects < ActiveRecord::Migration + def self.up + add_column :aspects, :chat_enabled, :boolean, default: false + end + + def self.down + remove_column :aspects, :chat_enabled + end +end diff --git a/db/migrate/20141024170120_create_chat_offline_messages.rb b/db/migrate/20141024170120_create_chat_offline_messages.rb new file mode 100644 index 000000000..8c30101b0 --- /dev/null +++ b/db/migrate/20141024170120_create_chat_offline_messages.rb @@ -0,0 +1,14 @@ +class CreateChatOfflineMessages < ActiveRecord::Migration + def self.up + create_table :chat_offline_messages do |t| + t.string :from, :null => false + t.string :to, :null => false + t.text :message, :null => false + t.datetime "created_at", :null => false + end + end + + def self.down + drop_table :chat_offline_messages + end +end diff --git a/db/schema.rb b/db/schema.rb index a19ba2b5f..d68d473ee 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20141001162851) do +ActiveRecord::Schema.define(version: 20141024170120) do create_table "account_deletions", force: true do |t| t.string "diaspora_handle" @@ -43,12 +43,13 @@ ActiveRecord::Schema.define(version: 20141001162851) do add_index "aspect_visibilities", ["shareable_id", "shareable_type"], name: "index_aspect_visibilities_on_shareable_id_and_shareable_type", using: :btree create_table "aspects", force: true do |t| - t.string "name", null: false - t.integer "user_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "contacts_visible", default: true, null: false + t.string "name", null: false + t.integer "user_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "contacts_visible", default: true, null: false t.integer "order_id" + t.boolean "chat_enabled", default: false end add_index "aspects", ["user_id", "contacts_visible"], name: "index_aspects_on_user_id_and_contacts_visible", using: :btree @@ -59,6 +60,32 @@ ActiveRecord::Schema.define(version: 20141001162851) do t.integer "person_id" end + create_table "chat_contacts", force: true do |t| + t.integer "user_id", null: false + t.string "jid", null: false + t.string "name" + t.string "ask", limit: 128 + t.string "subscription", limit: 128, null: false + end + + add_index "chat_contacts", ["user_id", "jid"], name: "index_chat_contacts_on_user_id_and_jid", unique: true, using: :btree + + create_table "chat_fragments", force: true 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 + + add_index "chat_fragments", ["user_id"], name: "index_chat_fragments_on_user_id", unique: true, using: :btree + + create_table "chat_offline_messages", force: true do |t| + t.string "from", null: false + t.string "to", null: false + t.text "message", null: false + t.datetime "created_at", null: false + end + create_table "comments", force: true do |t| t.text "text", null: false t.integer "commentable_id", null: false