# This migration comes from forum (originally 20140601) class CreateForumForums < ActiveRecord::Migration def change create_table :xforum_forums do |t| t.belongs_to :topic t.belongs_to :user t.string :owner_name, limit:50, default:'' t.integer :parent, default:0 t.string :state, limit:50, default:'new' t.integer :tag, default:-1 t.boolean :hold, default:false t.text :content t.boolean :closed, default:false t.string :response, default:'none' t.boolean :restricted, default:false t.boolean :needs_translating, default:false t.boolean :has_photo, default:false t.text :resolution t.timestamps end add_index :xforum_forums, :user_id, name: :index_forums_on_user_id add_index :xforum_forums, :topic_id, name: :index_forums_on_topic_id add_index :xforum_forums, %W(topic_id state), name: :index_forums_on_topic_and_state add_index :xforum_forums, :closed, name: :index_forums_on_closed add_index :xforum_forums, :hold, name: :index_forums_on_hold add_index :xforum_forums, :parent, name: :index_forums_on_parent add_index :xforum_forums, :state, name: :index_forums_on_state add_index :xforum_forums, :restricted, name: :index_forums_on_restricted add_index :xforum_forums, :has_photo, name: :index_forums_on_has_photo create_table :xforum_hyperlinks do |t| t.belongs_to :forum t.string :link_address t.string :link_text t.timestamp end add_index :xforum_hyperlinks, :forum_id, name: :index_forum_hyperlinks_on_forum_id create_table :xforum_languages do |t| t.belongs_to :user t.string :code, limit:5 t.string :name, limit:50 t.string :local_name, limit:50 t.string :region, limit:50 t.boolean :suggestion t.string :state, limit:50, default:'suggesiton' t.boolean :active, default:false t.timestamps end add_index :xforum_languages, :user_id, name: :index_forum_languages_on_user_id add_index :xforum_languages, :code, name: :index_forum_languages_on_code add_index :xforum_languages, :name, name: :index_forum_languages_on_name add_index :xforum_languages, :region, name: :index_forum_languages_on_region add_index :xforum_languages, :active, name: :index_forum_languages_on_active add_index :xforum_languages, :suggestion, name: :index_forum_languages_on_suggestion create_table :xforum_categories do |t| t.belongs_to :user t.string :name, limit:50 t.string :state, limit:50 t.boolean :suggestion t.boolean :closed, default:false t.timestamps end add_index :xforum_categories, :user_id, name: :index_forum_categories_on_user_id add_index :xforum_categories, :closed, name: :index_forum_categories_on_closed add_index :xforum_categories, :suggestion, name: :index_forum_categories_on_suggestion create_table :xforum_photos do |t| t.belongs_to :user t.belongs_to :forum t.string :name, limit:50 t.boolean :resized, default:false t.string :key t.timestamps end add_index :xforum_photos, :user_id, name: :index_forum_photos_on_user_id add_index :xforum_photos, :forum_id, name: :index_forum_photos_on_forum_id add_index :xforum_photos, :name, name: :index_forum_photos_on_name add_index :xforum_photos, :key, name: :index_forum_photos_on_key add_index :xforum_photos, :resized, name: :index_forum_photos_on_resized create_table :xforum_topics do |t| t.belongs_to :category t.belongs_to :user t.string :name, limit:50 t.string :state, limit:20 t.boolean :closed, default:false t.boolean :suggestion t.binary :votes, default:[] t.boolean :vote, default:false t.boolean :restricted, default:false t.timestamps end add_index :xforum_topics, :user_id, name: :index_forum_topics_on_user_id add_index :xforum_topics, :category_id, name: :index_forum_topics_on_category_id add_index :xforum_topics, :closed, name: :index_forum_topics_on_closed add_index :xforum_topics, :name, name: :index_forum_topics_on_name add_index :xforum_topics, :vote, name: :index_forum_topics_on_vote add_index :xforum_topics, :restricted, name: :index_forum_topics_on_restricted add_index :xforum_topics, :suggestion, name: :index_forum_topics_on_suggestion create_table :xforum_people_lists do |t| t.belongs_to :forum t.belongs_to :topic t.belongs_to :category t.string :name, limit:20 t.string :list, limit:20 t.binary :people, default:[] t.timestamps end add_index :xforum_people_lists, :forum_id, name: :index_forum_people_lists_on_forum_id add_index :xforum_people_lists, :category_id, name: :index_forum_people_lists_on_category_id add_index :xforum_people_lists, :topic_id, name: :index_forum_people_lists_on_topic_id add_index :xforum_people_lists, :name, name: :index_forum_people_lists_on_name add_index :xforum_people_lists, :list, name: :index_forum_people_lists_on_list create_table :xforum_translations do |t| t.belongs_to :forum t.belongs_to :user t.belongs_to :topic t.belongs_to :category t.belongs_to :language t.belongs_to :hyperlink t.boolean :suggestion, default:false t.string :state, limit:20, default:'new' t.text :content t.text :resolution t.timestamps end add_index :xforum_translations, :user_id, name: :index_forum_translations_on_user_id add_index :xforum_translations, :hyperlink_id, name: :index_forum_translations_on_hyperlink_id add_index :xforum_translations, :forum_id, name: :index_forum_translations_on_forum_id add_index :xforum_translations, :topic_id, name: :index_forum_translations_on_topic_id add_index :xforum_translations, :category_id, name: :index_forum_translations_on_category_id add_index :xforum_translations, :language_id, name: :index_forum_translations_on_language_id add_index :xforum_translations, :state, name: :index_forum_translations_on_state end end