Remove Rails 5 deprecation warning.
This commit is contained in:
parent
2e4b3e9b06
commit
1103ea7c4c
|
@ -5,7 +5,7 @@ class CreateForumThreads < ActiveRecord::Migration
|
|||
t.string :title, null: false
|
||||
t.integer :last_post_id
|
||||
t.datetime :last_posted_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreatePosts < ActiveRecord::Migration
|
|||
t.integer :post_number, null: false
|
||||
t.text :content, null: false
|
||||
t.text :formatted_content, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :posts, [:forum_thread_id, :created_at]
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateUsers < ActiveRecord::Migration
|
|||
create_table :users do |t|
|
||||
t.string :username, limit: 20, null: false
|
||||
t.string :avatar_url, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateForums < ActiveRecord::Migration
|
|||
create_table :forums do |t|
|
||||
t.integer :site_id, null: false
|
||||
t.string :title, limit: 100, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateSites < ActiveRecord::Migration
|
|||
def change
|
||||
create_table :sites do |t|
|
||||
t.string :title, limit: 100, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ class CreateVestalVersions < ActiveRecord::Migration
|
|||
t.integer :reverted_from
|
||||
t.string :tag
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
change_table :versions do |t|
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateExpressions < ActiveRecord::Migration
|
|||
t.string :parent_type, null: false, limit: 50
|
||||
t.integer :expression_type_id, null: false
|
||||
t.integer :user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :expressions, [:parent_id, :parent_type, :expression_type_id, :user_id], unique: true, name: "expressions_pk"
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateExpressionTypes < ActiveRecord::Migration
|
|||
t.integer :site_id, null: false
|
||||
t.string :name, null: false, limit: 50
|
||||
t.string :long_form, null: false, limit: 100
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :expression_types, [:site_id, :name], unique: true
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateLastReadPosts < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.integer :forum_thread_id, null: false
|
||||
t.integer :post_number, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :last_read_posts, [:user_id, :forum_thread_id], unique: true
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreateUploads < ActiveRecord::Migration
|
|||
t.integer :width, null: true
|
||||
t.integer :height, null: true
|
||||
t.string :url, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :uploads, :forum_thread_id
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateStars < ActiveRecord::Migration
|
|||
t.integer :parent_id, null: false
|
||||
t.string :parent_type, limit: 50, null: false
|
||||
t.integer :user_id, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :stars, [:parent_id, :parent_type, :user_id]
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateForumThreadUser < ActiveRecord::Migration
|
|||
t.boolean :starred, null: false, default: false
|
||||
t.boolean :posted, null: false, default: false
|
||||
t.integer :last_read_post_number, null: false, default: 1
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
execute "DELETE FROM read_posts"
|
||||
|
@ -24,7 +24,7 @@ class CreateForumThreadUser < ActiveRecord::Migration
|
|||
t.integer :parent_id, null: false
|
||||
t.string :parent_type, limit: 50, null: false
|
||||
t.integer :user_id, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :stars, [:parent_id, :parent_type, :user_id]
|
||||
|
@ -33,7 +33,7 @@ class CreateForumThreadUser < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.integer :forum_thread_id, null: false
|
||||
t.integer :post_number, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :last_read_posts, [:user_id, :forum_thread_id], unique: true
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreateForumThreadLinks < ActiveRecord::Migration
|
|||
t.string :domain, limit: 100, null: false
|
||||
t.boolean :internal, null: false, default: false
|
||||
t.integer :link_forum_thread_id, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :forum_thread_links, :forum_thread_id
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateBookmarks < ActiveRecord::Migration
|
|||
create_table :bookmarks do |t|
|
||||
t.integer :user_id
|
||||
t.integer :post_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :bookmarks, [:user_id, :post_id], unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class AddPostNumberToBookmarks < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.integer :forum_thread_id, null: false
|
||||
t.integer :post_number, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :bookmarks, [:user_id, :forum_thread_id, :post_number], unique: true
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateNotifications < ActiveRecord::Migration
|
|||
t.references :user, null: false
|
||||
t.string :data, null: false
|
||||
t.boolean :read, default: false, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :notifications, [:user_id, :created_at]
|
||||
|
|
|
@ -7,7 +7,7 @@ class CreateIncomingLinks < ActiveRecord::Migration
|
|||
t.string :domain, limit: 100, null: false
|
||||
t.integer :forum_thread_id, null: true
|
||||
t.integer :post_number, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :incoming_links, [:site_id, :forum_thread_id, :post_number], name: 'incoming_index'
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateReplies < ActiveRecord::Migration
|
|||
create_table :post_replies, id: false do |t|
|
||||
t.references :post
|
||||
t.integer :reply_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :post_replies, [:post_id, :reply_id], unique: true
|
||||
|
|
|
@ -9,7 +9,7 @@ class CreateCategories < ActiveRecord::Migration
|
|||
t.integer :top1_user_id, null: true
|
||||
t.integer :top2_user_id, null: true
|
||||
t.integer :forum_thread_count, null: false, default: 0
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :categories, :name, unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateCategoryFeaturedThreads < ActiveRecord::Migration
|
|||
create_table :category_featured_threads, id: false do |t|
|
||||
t.references :category, null: false
|
||||
t.references :forum_thread, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :category_featured_threads, [:category_id, :forum_thread_id], unique: true, name: 'cat_featured_threads'
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateSiteSettings < ActiveRecord::Migration
|
|||
t.integer :data_type, null: false
|
||||
t.text :value
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateUserOpenIds < ActiveRecord::Migration
|
|||
t.integer :user_id
|
||||
t.string :email
|
||||
t.string :url
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_open_ids, [:url]
|
||||
|
|
|
@ -15,7 +15,7 @@ class CreateActions < ActiveRecord::Migration
|
|||
t.integer :target_user_id
|
||||
t.integer :acting_user_id
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :actions, [:user_id, :action_type]
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreatePostActions < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.integer :post_action_type_id, null: false
|
||||
t.datetime :deleted_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :post_actions, ["post_id"]
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreatePostActionTypes < ActiveRecord::Migration
|
|||
t.text :description
|
||||
t.string :icon, limit: 20
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateForumThreadLinkClicks < ActiveRecord::Migration
|
|||
t.references :forum_thread_link, null: false
|
||||
t.references :user, null: true
|
||||
t.integer :ip, null: false, limit: 8
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_column :forum_thread_links, :clicks, :integer, default: 0, null: false
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateCategoryFeaturedUsers < ActiveRecord::Migration
|
|||
create_table :category_featured_users do |t|
|
||||
t.references :category
|
||||
t.references :user
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :category_featured_users, [:category_id, :user_id], unique: true
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateOneboxRenders < ActiveRecord::Migration
|
|||
t.string :url, null: false
|
||||
t.text :cooked, null: false
|
||||
t.datetime :expires_at, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :onebox_renders, :url, unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreatePostOneboxRenders < ActiveRecord::Migration
|
|||
create_table :post_onebox_renders, id: false do |t|
|
||||
t.references :post, null: false
|
||||
t.references :onebox_render, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :post_onebox_renders, [:post_id, :onebox_render_id], unique: true
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddTwitterUserInfo < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :screen_name, null: false
|
||||
t.integer :twitter_user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :twitter_user_infos, [:twitter_user_id], unique: true
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateArchetypes < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :archetypes do |t|
|
||||
t.string :name_key, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :archetypes, :name_key, unique: true
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateArchetypeOptions < ActiveRecord::Migration
|
|||
t.references :archetype, null: false
|
||||
t.string :key, null: false
|
||||
t.integer :option_type, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :archetype_options, :archetype_id
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateEmailLogs < ActiveRecord::Migration
|
|||
t.string :to_address, null: false
|
||||
t.string :email_type, null: false
|
||||
t.integer :user_id, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :email_logs, :created_at, order: { created_at: :desc }
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateTopicAllowedUsers < ActiveRecord::Migration
|
|||
create_table :topic_allowed_users do |t|
|
||||
t.integer :user_id, null: false
|
||||
t.integer :topic_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :topic_allowed_users, [:topic_id, :user_id], unique: true
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateTrustLevels < ActiveRecord::Migration
|
|||
def change
|
||||
create_table :trust_levels do |t|
|
||||
t.string :name_key, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_column :users, :trust_level_id, :integer, default: 1, null: false
|
||||
|
|
|
@ -11,7 +11,7 @@ class CreateFacebookUserInfos < ActiveRecord::Migration
|
|||
t.string :name
|
||||
t.string :link
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :facebook_user_infos, :user_id, unique: true
|
||||
add_index :facebook_user_infos, :facebook_user_id, unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateInvites < ActiveRecord::Migration
|
|||
t.integer :invited_by_id, null: false
|
||||
t.integer :user_id, null: true
|
||||
t.timestamp :redeemed_at, null: true
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :invites, :invite_key, unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateTopicInvites < ActiveRecord::Migration
|
|||
create_table :topic_invites do |t|
|
||||
t.references :topic, null: false
|
||||
t.references :invite, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :topic_invites, [:topic_id, :invite_id], unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateEmailTokens < ActiveRecord::Migration
|
|||
t.string :token, null: false
|
||||
t.boolean :confirmed, null: false, default: false
|
||||
t.boolean :expired, null: false, default: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :email_tokens, :token, unique: true
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateDrafts < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :draft_key, null: false
|
||||
t.text :data, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :drafts, [:user_id, :draft_key]
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreateSiteCustomizations < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.boolean :enabled, null: false
|
||||
t.string :key, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :site_customizations, [:key]
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddGithubUserInfo < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :screen_name, null: false
|
||||
t.integer :github_user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :github_user_infos, [:github_user_id], unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateSiteContents < ActiveRecord::Migration
|
|||
create_table :site_contents, force: true, id: false do |t|
|
||||
t.string :content_type, null: false
|
||||
t.text :content, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :site_contents, :content_type, unique: true
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateAdminLogs < ActiveRecord::Migration
|
|||
t.integer :admin_id, null: false
|
||||
t.integer :target_user_id
|
||||
t.text :details
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateGroups < ActiveRecord::Migration
|
|||
def change
|
||||
create_table :groups, force: true do |t|
|
||||
t.string :name, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class GroupUsers < ActiveRecord::Migration
|
|||
create_table :group_users, force: true do |t|
|
||||
t.integer :group_id, null: false
|
||||
t.integer :user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :group_users, [:group_id, :user_id], unique: true
|
||||
|
|
|
@ -5,7 +5,7 @@ class AddSecurityToCategories < ActiveRecord::Migration
|
|||
create_table :category_groups, force: true do |t|
|
||||
t.integer :category_id, null: false
|
||||
t.integer :group_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ class CreateCasUserInfos < ActiveRecord::Migration
|
|||
t.string :name
|
||||
t.string :link
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :cas_user_infos, :user_id, unique: true
|
||||
add_index :cas_user_infos, :cas_user_id, unique: true
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateBlockedEmails < ActiveRecord::Migration
|
|||
t.integer :action_type, null: false
|
||||
t.integer :match_count, null: false, default: 0
|
||||
t.datetime :last_match_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :blocked_emails, :email, unique: true
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateScreenedUrls < ActiveRecord::Migration
|
|||
t.integer :action_type, null: false
|
||||
t.integer :match_count, null: false, default: 0
|
||||
t.datetime :last_match_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :screened_urls, :url, unique: true
|
||||
add_index :screened_urls, :last_match_at
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateOauth2UserInfos < ActiveRecord::Migration
|
|||
t.string :provider, null: false
|
||||
t.string :email
|
||||
t.string :name
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :oauth2_user_infos, [:uid, :provider], unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreatePostDetails < ActiveRecord::Migration
|
|||
t.string :value, size: 512
|
||||
t.text :extra
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :post_details, [:post_id, :key], unique: true
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateScreenedIpAddresses < ActiveRecord::Migration
|
|||
t.integer :action_type, null: false
|
||||
t.integer :match_count, null: false, default: 0
|
||||
t.datetime :last_match_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :screened_ip_addresses, :ip_address, unique: true
|
||||
add_index :screened_ip_addresses, :last_match_at
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateApiKeys < ActiveRecord::Migration
|
|||
t.string :key, limit: 64, null: false
|
||||
t.integer :user_id, null: true
|
||||
t.integer :created_by_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :api_keys, :key
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreatePostRevisions < ActiveRecord::Migration
|
|||
t.belongs_to :post
|
||||
t.text :modifications
|
||||
t.integer :number
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
execute "INSERT INTO post_revisions (user_id, post_id, modifications, number, created_at, updated_at)
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateTopicRevisions < ActiveRecord::Migration
|
|||
t.belongs_to :topic
|
||||
t.text :modifications
|
||||
t.integer :number
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
execute "INSERT INTO topic_revisions (user_id, topic_id, modifications, number, created_at, updated_at)
|
||||
|
|
|
@ -5,7 +5,7 @@ class CreateTopicEmbeds < ActiveRecord::Migration
|
|||
t.integer :post_id, null: false
|
||||
t.string :embed_url, null: false
|
||||
t.string :content_sha1, null: false, limit: 40
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :topic_embeds, :embed_url, unique: true
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddSingleSignOnRecords < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :external_id, null: false, length: 255
|
||||
t.text :last_payload, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :single_sign_on_records, :external_id, unique: true
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateBadgeTypes < ActiveRecord::Migration
|
|||
t.string :name, null: false
|
||||
t.string :color_hexcode, null: false
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :badge_types, [:name], unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateBadges < ActiveRecord::Migration
|
|||
t.integer :badge_type_id, index: true, null: false
|
||||
t.integer :grant_count, null: false, default: 0
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :badges, [:name], unique: true
|
||||
|
|
|
@ -7,7 +7,7 @@ class CreateColorSchemes < ActiveRecord::Migration
|
|||
t.integer :versioned_id
|
||||
t.integer :version, null: false, default: 1
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateColorSchemeColors < ActiveRecord::Migration
|
|||
t.integer :opacity, null: false, default: 100
|
||||
t.integer :color_scheme_id, null: false
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :color_scheme_colors, [:color_scheme_id]
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddUserCustomFields < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :name, limit: 256, null: false
|
||||
t.text :value
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_custom_fields, [:user_id, :name]
|
||||
|
|
|
@ -4,21 +4,21 @@ class AddCustomFields < ActiveRecord::Migration
|
|||
t.integer :category_id, null: false
|
||||
t.string :name, limit: 256, null: false
|
||||
t.text :value
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :group_custom_fields do |t|
|
||||
t.integer :group_id, null: false
|
||||
t.string :name, limit: 256, null: false
|
||||
t.text :value
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :post_custom_fields do |t|
|
||||
t.integer :post_id, null: false
|
||||
t.string :name, limit: 256, null: false
|
||||
t.text :value
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :category_custom_fields, [:category_id, :name]
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddTopicCustomFields < ActiveRecord::Migration
|
|||
t.integer :topic_id, null: false
|
||||
t.string :name, limit: 256, null: false
|
||||
t.text :value
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :topic_custom_fields, [:topic_id, :name]
|
||||
|
|
|
@ -3,7 +3,7 @@ class AddInvitedGroups < ActiveRecord::Migration
|
|||
create_table :invited_groups do |t|
|
||||
t.integer :group_id
|
||||
t.integer :invite_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class CreateGoogleUserInfos < ActiveRecord::Migration
|
|||
t.string :profile_link
|
||||
t.string :picture
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :google_user_infos, :user_id, unique: true
|
||||
add_index :google_user_infos, :google_user_id, unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class AddUserAvatars < ActiveRecord::Migration
|
|||
t.integer :custom_upload_id
|
||||
t.integer :gravatar_upload_id
|
||||
t.datetime :last_gravatar_download_attempt
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_avatars, [:user_id]
|
||||
|
|
|
@ -3,7 +3,7 @@ class AddQuotedPosts < ActiveRecord::Migration
|
|||
create_table :quoted_posts do |t|
|
||||
t.integer :post_id, null: false
|
||||
t.integer :quoted_post_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :quoted_posts, [:post_id, :quoted_post_id], unique: true
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddBadgeGroupings < ActiveRecord::Migration
|
|||
t.string :name, null: false
|
||||
t.string :description, null: false
|
||||
t.integer :position, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_column :badges, :badge_grouping_id, :integer
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreatePermalinks < ActiveRecord::Migration
|
|||
t.integer :post_id
|
||||
t.integer :category_id
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :permalinks, :url
|
||||
|
|
|
@ -4,7 +4,7 @@ class CreateWarnings < ActiveRecord::Migration
|
|||
t.references :topic, null: false
|
||||
t.references :user, null: false
|
||||
t.integer :created_by_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :warnings, :user_id
|
||||
add_index :warnings, :topic_id, unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateUserFields < ActiveRecord::Migration
|
|||
create_table :user_fields do |t|
|
||||
t.string :name, null: false
|
||||
t.string :field_type, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateCsvExportLogs < ActiveRecord::Migration
|
|||
create_table :csv_export_logs do |t|
|
||||
t.string :export_type, null: false
|
||||
t.integer :user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class GroupManagers < ActiveRecord::Migration
|
|||
create_table :group_managers do |t|
|
||||
t.integer :group_id, null: false
|
||||
t.integer :user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :group_managers, [:group_id, :user_id], unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateDigestUnsubscribeKeys < ActiveRecord::Migration
|
|||
create_table :digest_unsubscribe_keys, id: false do |t|
|
||||
t.string :key, limit: 64, null: false
|
||||
t.integer :user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
execute "ALTER TABLE digest_unsubscribe_keys ADD PRIMARY KEY (key)"
|
||||
add_index :digest_unsubscribe_keys, :created_at
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreateDirectoryItems < ActiveRecord::Migration
|
|||
t.integer :topics_entered, null: false
|
||||
t.integer :topic_count, null: false
|
||||
t.integer :post_count, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :directory_items, :period_type
|
||||
|
|
|
@ -3,7 +3,7 @@ class AddMutedUsers < ActiveRecord::Migration
|
|||
create_table :muted_users, force: true do |t|
|
||||
t.integer :user_id, null: false
|
||||
t.integer :muted_user_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :muted_users, [:user_id, :muted_user_id], unique: true
|
||||
|
|
|
@ -11,7 +11,7 @@ class CreateQueuedPosts < ActiveRecord::Migration
|
|||
t.timestamp :approved_at
|
||||
t.integer :rejected_by_id
|
||||
t.timestamp :rejected_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :queued_posts, [:queue, :state, :created_at], name: 'by_queue_status'
|
||||
|
|
|
@ -4,7 +4,7 @@ class AddStylesheetCache < ActiveRecord::Migration
|
|||
t.string :target, null: false
|
||||
t.string :digest, null: false
|
||||
t.text :content, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :stylesheet_cache, [:target, :digest], unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateUserFieldOptions < ActiveRecord::Migration
|
|||
create_table :user_field_options, force: true do |t|
|
||||
t.references :user_field, null: false
|
||||
t.string :value, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ class AddPostStats < ActiveRecord::Migration
|
|||
t.integer :drafts_saved
|
||||
t.integer :typing_duration_msecs
|
||||
t.integer :composer_open_duration_msecs
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :post_stats, [:post_id]
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateEmbeddableHosts < ActiveRecord::Migration
|
|||
create_table :embeddable_hosts, force: true do |t|
|
||||
t.string :host, null: false
|
||||
t.integer :category_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
category_id = 0;
|
||||
|
|
|
@ -3,7 +3,7 @@ class AddGroupMentions < ActiveRecord::Migration
|
|||
create_table :group_mentions do |t|
|
||||
t.integer :post_id
|
||||
t.integer :group_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :group_mentions, [:post_id, :group_id], unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class AddUserArchivedMessagesGroupArchivedMessages < ActiveRecord::Migration
|
|||
create_table :user_archived_messages do |t|
|
||||
t.integer :user_id, null: false
|
||||
t.integer :topic_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_archived_messages, [:user_id, :topic_id], unique: true
|
||||
|
@ -11,7 +11,7 @@ class AddUserArchivedMessagesGroupArchivedMessages < ActiveRecord::Migration
|
|||
create_table :group_archived_messages do |t|
|
||||
t.integer :group_id, null: false
|
||||
t.integer :topic_id, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :group_archived_messages, [:group_id, :topic_id], unique: true
|
||||
|
|
|
@ -3,20 +3,20 @@ class CreateTags < ActiveRecord::Migration
|
|||
create_table :tags do |t|
|
||||
t.string :name, null: false
|
||||
t.integer :topic_count, null: false, default: 0
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :topic_tags do |t|
|
||||
t.references :topic, null: false
|
||||
t.references :tag, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :tag_users do |t|
|
||||
t.references :tag, null: false
|
||||
t.references :user, null: false
|
||||
t.integer :notification_level, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :tags, :name, unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateCategoryTags < ActiveRecord::Migration
|
|||
create_table :category_tags do |t|
|
||||
t.references :category, null: false
|
||||
t.references :tag, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :category_tags, [:category_id, :tag_id], name: "idx_category_tags_ix1", unique: true
|
||||
|
|
|
@ -3,13 +3,13 @@ class CreateTagGroups < ActiveRecord::Migration
|
|||
create_table :tag_groups do |t|
|
||||
t.string :name, null: false
|
||||
t.integer :tag_count, null: false, default: 0
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :tag_group_memberships do |t|
|
||||
t.references :tag, null: false
|
||||
t.references :tag_group, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :tag_group_memberships, [:tag_group_id, :tag_id], unique: true
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateCategoryTagGroups < ActiveRecord::Migration
|
|||
create_table :category_tag_groups do |t|
|
||||
t.references :category, null: false
|
||||
t.references :tag_group, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :category_tag_groups, [:category_id, :tag_group_id], name: "idx_category_tag_groups_ix1", unique: true
|
||||
|
|
|
@ -9,7 +9,7 @@ class AddUserApiKeys < ActiveRecord::Migration
|
|||
t.boolean :write, null: false
|
||||
t.boolean :push, null: false
|
||||
t.string :push_url
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_api_keys, [:key], unique: true
|
||||
|
|
|
@ -10,7 +10,7 @@ class CreateWebHooks < ActiveRecord::Migration
|
|||
t.boolean :verify_certificate, default: true, null: false
|
||||
t.boolean :active, default: false, null: false
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ class CreateWebHookEvents < ActiveRecord::Migration
|
|||
t.text :response_body
|
||||
t.integer :duration, default: 0
|
||||
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ SQL
|
|||
t.boolean :legacy, default: false, null: false
|
||||
t.inet :client_ip
|
||||
t.datetime :rotated_at, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_auth_tokens, [:auth_token]
|
||||
|
|
|
@ -9,7 +9,7 @@ class AddThemes < ActiveRecord::Migration
|
|||
create_table :child_themes do |t|
|
||||
t.integer :parent_theme_id
|
||||
t.integer :child_theme_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :child_themes, [:parent_theme_id, :child_theme_id], unique: true
|
||||
|
|
|
@ -8,7 +8,7 @@ class CreateTopicStatusUpdates < ActiveRecord::Migration
|
|||
t.boolean :based_on_last_post, null: false, default: false
|
||||
t.datetime :deleted_at
|
||||
t.integer :deleted_by_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :topic_status_updates, :user_id
|
||||
|
|
|
@ -6,7 +6,7 @@ class BreakUpThemesTable < ActiveRecord::Migration
|
|||
t.string :name, null: false
|
||||
t.text :value, null: false
|
||||
t.text :value_baked
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :theme_fields, [:theme_id, :target, :name], unique: true
|
||||
|
|
|
@ -8,7 +8,7 @@ class AddThemeRemoteFields < ActiveRecord::Migration
|
|||
t.string :license_url
|
||||
t.integer :commits_behind
|
||||
t.datetime :remote_updated_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_column :themes, :remote_theme_id, :integer
|
||||
|
|
|
@ -10,7 +10,7 @@ class CreateTopicStatusUpdatesAgain < ActiveRecord::Migration
|
|||
t.boolean :based_on_last_post, null: false, default: false
|
||||
t.datetime :deleted_at
|
||||
t.integer :deleted_by_id
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
t.integer :category_id
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ class CreateWatchedWords < ActiveRecord::Migration
|
|||
create_table :watched_words do |t|
|
||||
t.string :word, null: false
|
||||
t.integer :action, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :watched_words, [:action, :word], unique: true
|
||||
|
|
|
@ -6,7 +6,7 @@ class CreateUserEmails < ActiveRecord::Migration
|
|||
t.integer :user_id, null: false
|
||||
t.string :email, limit: 513, null: false
|
||||
t.boolean :primary, default: false, null: false
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :user_emails, :user_id
|
||||
|
|
Loading…
Reference in New Issue