mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix all the errors to get our tests green on Rails 5.1.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class AddSchemaMigrationDetails < ActiveRecord::Migration
|
||||
class AddSchemaMigrationDetails < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
# schema_migrations table is way too thin, does not give info about
|
||||
# duration of migration or the date it happened, this migration together with the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateForumThreads < ActiveRecord::Migration
|
||||
class CreateForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :forum_threads do |t|
|
||||
t.integer :forum_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreatePosts < ActiveRecord::Migration
|
||||
class CreatePosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :posts do |t|
|
||||
t.integer :user_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
class CreateUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.string :username, limit: 20, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateForums < ActiveRecord::Migration
|
||||
class CreateForums < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :forums do |t|
|
||||
t.integer :site_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSites < ActiveRecord::Migration
|
||||
class CreateSites < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :sites do |t|
|
||||
t.string :title, limit: 100, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddReplyToToPosts < ActiveRecord::Migration
|
||||
class AddReplyToToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :reply_to_post_number, :integer, null: true
|
||||
add_index :posts, :reply_to_post_number
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddViewsToForumThreads < ActiveRecord::Migration
|
||||
class AddViewsToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :views, :integer, default: 0, null: false
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddPostsCountToForumThreads < ActiveRecord::Migration
|
||||
class AddPostsCountToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :posts_count, :integer, default: 0, null: false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class FixPostIndices < ActiveRecord::Migration
|
||||
class FixPostIndices < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_index :posts, [:forum_thread_id, :created_at]
|
||||
add_index :posts, [:forum_thread_id, :post_number]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveLastPostId < ActiveRecord::Migration
|
||||
class RemoveLastPostId < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column :forum_threads, :last_post_id
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddDisplayUsernameToUsers < ActiveRecord::Migration
|
||||
class AddDisplayUsernameToUsers < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users, :display_username, :string
|
||||
execute "UPDATE users SET display_username = username"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddUserIdIndexToPosts < ActiveRecord::Migration
|
||||
class AddUserIdIndexToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :posts, :user_id
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CookedMigration < ActiveRecord::Migration
|
||||
class CookedMigration < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_column :posts, :content, :raw
|
||||
rename_column :posts, :formatted_content, :cooked
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateVestalVersions < ActiveRecord::Migration
|
||||
class CreateVestalVersions < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :versions do |t|
|
||||
t.belongs_to :versioned, polymorphic: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddVersionToPosts < ActiveRecord::Migration
|
||||
class AddVersionToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :cached_version, :integer, null: false, default: 1
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddCreatedByToForumThreads < ActiveRecord::Migration
|
||||
class AddCreatedByToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :forum_threads, :user_id, :integer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddLastPostUserIdToForumThreads < ActiveRecord::Migration
|
||||
class AddLastPostUserIdToForumThreads < ActiveRecord::Migration[4.2]
|
||||
|
||||
def up
|
||||
add_column :forum_threads, :last_post_user_id, :integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddSiteIdToUsers < ActiveRecord::Migration
|
||||
class AddSiteIdToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :site_id, :integer
|
||||
add_column :users, :bio, :text
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateExpressions < ActiveRecord::Migration
|
||||
class CreateExpressions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :expressions, id: false, force: true do |t|
|
||||
t.integer :parent_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateExpressionTypes < ActiveRecord::Migration
|
||||
class CreateExpressionTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :expression_types do |t|
|
||||
t.integer :site_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddReplyCountToPosts < ActiveRecord::Migration
|
||||
class AddReplyCountToPosts < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :posts, :reply_count, :integer, null: false, default: 0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddFlagToExpressionTypes < ActiveRecord::Migration
|
||||
class AddFlagToExpressionTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :expression_types, :flag, :boolean, default: false
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddDescriptionToExpressionTypes < ActiveRecord::Migration
|
||||
class AddDescriptionToExpressionTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :expression_types, :description, :text, null: true
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddQuotelessToPost < ActiveRecord::Migration
|
||||
class AddQuotelessToPost < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :quoteless, :boolean, default: false
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateReadPosts < ActiveRecord::Migration
|
||||
class CreateReadPosts < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :read_posts, id: false do |t|
|
||||
t.integer :forum_thread_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateLastReadPosts < ActiveRecord::Migration
|
||||
class CreateLastReadPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :last_read_posts do |t|
|
||||
t.integer :user_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateViews < ActiveRecord::Migration
|
||||
class CreateViews < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :views, id: false do |t|
|
||||
t.integer :parent_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddRepliesToForumThreads < ActiveRecord::Migration
|
||||
class AddRepliesToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :reply_count, :integer, default: 0, null: false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddFeaturedToForumThreads < ActiveRecord::Migration
|
||||
class AddFeaturedToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :forum_threads, :featured_user1_id, :integer, null: true
|
||||
add_column :forum_threads, :featured_user2_id, :integer, null: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddAvgTimeToForumThreads < ActiveRecord::Migration
|
||||
class AddAvgTimeToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :forum_threads, :avg_time, :integer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateUploads < ActiveRecord::Migration
|
||||
class CreateUploads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :uploads do |t|
|
||||
t.integer :user_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateStars < ActiveRecord::Migration
|
||||
class CreateStars < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :stars, id: false do |t|
|
||||
t.integer :parent_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateForumThreadUser < ActiveRecord::Migration
|
||||
class CreateForumThreadUser < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :forum_thread_users, id: false do |t|
|
||||
t.integer :user_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class MigratePosted < ActiveRecord::Migration
|
||||
class MigratePosted < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddIndexToForumThreads < ActiveRecord::Migration
|
||||
class AddIndexToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :forum_threads, :last_posted_at
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateForumThreadLinks < ActiveRecord::Migration
|
||||
class CreateForumThreadLinks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :forum_thread_links do |t|
|
||||
t.integer :forum_thread_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddTagsToForumThreads < ActiveRecord::Migration
|
||||
class AddTagsToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :tag, :string, null: true, limit: 25
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddQuoteCountToPosts < ActiveRecord::Migration
|
||||
class AddQuoteCountToPosts < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :posts, :quote_count, :integer, default: 0, null: false
|
||||
execute "UPDATE posts SET quote_count = 1 WHERE quoteless = 'f'"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateBookmarks < ActiveRecord::Migration
|
||||
class CreateBookmarks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :bookmarks do |t|
|
||||
t.integer :user_id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddReplyBelowToPosts < ActiveRecord::Migration
|
||||
class AddReplyBelowToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :reply_below_post_number, :integer, null: true
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreatePostTimings < ActiveRecord::Migration
|
||||
class CreatePostTimings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :post_timings do |t|
|
||||
t.integer :thread_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMessageBus < ActiveRecord::Migration
|
||||
class CreateMessageBus < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :message_bus do |t|
|
||||
t.string :name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class FixPostTimings < ActiveRecord::Migration
|
||||
class FixPostTimings < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_index :post_timings, [:thread_id, :post_number]
|
||||
remove_index :post_timings, [:thread_id, :post_number, :user_id]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class DropReadPosts < ActiveRecord::Migration
|
||||
class DropReadPosts < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
drop_table :read_posts
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddPostNumberToBookmarks < ActiveRecord::Migration
|
||||
class AddPostNumberToBookmarks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
drop_table :bookmarks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddSeenPostCountToForumThreadUsers < ActiveRecord::Migration
|
||||
class AddSeenPostCountToForumThreadUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :post_timings, :id
|
||||
remove_column :forum_thread_users, :created_at
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddDeletedAtToForumThreads < ActiveRecord::Migration
|
||||
class AddDeletedAtToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :deleted_at, :datetime
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateNotifications < ActiveRecord::Migration
|
||||
class CreateNotifications < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :notifications do |t|
|
||||
t.integer :notification_type, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddSeenNotificationIdToUsers < ActiveRecord::Migration
|
||||
class AddSeenNotificationIdToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
|
||||
execute "TRUNCATE TABLE notifications"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddDeletedAtToPosts < ActiveRecord::Migration
|
||||
class AddDeletedAtToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :deleted_at, :datetime
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddHighestPostNumberToForumThreads < ActiveRecord::Migration
|
||||
class AddHighestPostNumberToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :highest_post_number, :integer, default: 0, null: false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddImageUrlToForumThreads < ActiveRecord::Migration
|
||||
class AddImageUrlToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :image_url, :string
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RenameExpressionTypeId < ActiveRecord::Migration
|
||||
class RenameExpressionTypeId < ActiveRecord::Migration[4.2]
|
||||
|
||||
def up
|
||||
add_column :expression_types, :expression_index, :integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class DenormalizeExpressions < ActiveRecord::Migration
|
||||
class DenormalizeExpressions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
|
||||
# Denormalizing this makes our queries so, so, so much nicer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class MakeExpressionsLessGeneric < ActiveRecord::Migration
|
||||
class MakeExpressionsLessGeneric < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
rename_column :expressions, :parent_id, :post_id
|
||||
rename_column :expressions, :expression_type_id, :expression_index
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateIncomingLinks < ActiveRecord::Migration
|
||||
class CreateIncomingLinks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :incoming_links do |t|
|
||||
t.integer :site_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateReplies < ActiveRecord::Migration
|
||||
class CreateReplies < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :post_replies, id: false do |t|
|
||||
t.references :post
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddReflectionToForumThreadLinks < ActiveRecord::Migration
|
||||
class AddReflectionToForumThreadLinks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_thread_links, :reflection, :boolean, default: false
|
||||
change_column :forum_thread_links, :post_id, :integer, null: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddIncomingLinkCountToPosts < ActiveRecord::Migration
|
||||
class AddIncomingLinkCountToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :incoming_link_count, :integer, default: 0, null: false
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddIncomingLinkCountToForumThreads < ActiveRecord::Migration
|
||||
class AddIncomingLinkCountToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :forum_threads, :incoming_link_count, :integer, default: 0, null: false
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddBookmarkCountToPosts < ActiveRecord::Migration
|
||||
class AddBookmarkCountToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :bookmark_count, :integer, default: 0, null: false
|
||||
add_column :forum_threads, :bookmark_count, :integer, default: 0, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddAvgTimeToPosts < ActiveRecord::Migration
|
||||
class AddAvgTimeToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :avg_time, :integer, null: true
|
||||
add_column :posts, :score, :float, null: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddViewCountToPosts < ActiveRecord::Migration
|
||||
class AddViewCountToPosts < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :posts, :views, :integer, default: 0, null: false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddUserToVersions < ActiveRecord::Migration
|
||||
class AddUserToVersions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
execute "UPDATE versions SET user_type = 'User', user_id = posts.user_id
|
||||
FROM posts
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddLastPostedAtToUsers < ActiveRecord::Migration
|
||||
class AddLastPostedAtToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :last_posted_at, :datetime, null: true
|
||||
add_index :users, :last_posted_at
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateCategories < ActiveRecord::Migration
|
||||
class CreateCategories < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :categories do |t|
|
||||
t.string :name, limit: 50, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddCategoryIdToForumThreads < ActiveRecord::Migration
|
||||
class AddCategoryIdToForumThreads < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :forum_threads, :category_id, :integer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateCategoryFeaturedThreads < ActiveRecord::Migration
|
||||
class CreateCategoryFeaturedThreads < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :category_featured_threads, id: false do |t|
|
||||
t.references :category, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSiteSettings < ActiveRecord::Migration
|
||||
class CreateSiteSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :site_settings do |t|
|
||||
t.string :name, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddStatsToCategories < ActiveRecord::Migration
|
||||
class AddStatsToCategories < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :categories, :posts_year, :integer
|
||||
add_column :categories, :posts_month, :integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateUserOpenIds < ActiveRecord::Migration
|
||||
class CreateUserOpenIds < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :user_open_ids do |t|
|
||||
t.integer :user_id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddEmailHashedPasswordNameSaltToUsers < ActiveRecord::Migration
|
||||
class AddEmailHashedPasswordNameSaltToUsers < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users, :email, :string, limit: 256
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddUsernameLowerToUsers < ActiveRecord::Migration
|
||||
class AddUsernameLowerToUsers < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users, :username_lower, :string, limit: 20
|
||||
execute "update users set username_lower = lower(username)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddAuthTokenToUsers < ActiveRecord::Migration
|
||||
class AddAuthTokenToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :auth_token, :string, limit: 32
|
||||
add_index :users, [:auth_token]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddForumIdToCategories < ActiveRecord::Migration
|
||||
class AddForumIdToCategories < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :categories, :forum_id, :integer
|
||||
execute "UPDATE categories SET forum_id = (SELECT MIN(id) FROM forums)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddNotNullsToUserOpenIds < ActiveRecord::Migration
|
||||
class AddNotNullsToUserOpenIds < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column :user_open_ids, :user_id, :integer, null: false
|
||||
change_column :user_open_ids, :email, :string, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddLastSeenAtToUsers < ActiveRecord::Migration
|
||||
class AddLastSeenAtToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :last_seen_at, :datetime
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddWebsiteToUsers < ActiveRecord::Migration
|
||||
class AddWebsiteToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :website, :string
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddExcerptToCategories < ActiveRecord::Migration
|
||||
class AddExcerptToCategories < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :categories, :excerpt, :string, limit: 250
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddInvisibleToForumThread < ActiveRecord::Migration
|
||||
class AddInvisibleToForumThread < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :forum_threads, :invisible, :boolean, default: false, null: false
|
||||
change_column :categories, :excerpt, :text, null: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddUserIdToCategories < ActiveRecord::Migration
|
||||
class AddUserIdToCategories < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :categories, :user_id, :integer
|
||||
execute "UPDATE categories SET user_id = 1186"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveExcerptFromCategories < ActiveRecord::Migration
|
||||
class RemoveExcerptFromCategories < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column :categories, :excerpt
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RenameInvisible < ActiveRecord::Migration
|
||||
class RenameInvisible < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
|
||||
add_column :forum_threads, :visible, :boolean, default: true, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddThreadCountsToCategories < ActiveRecord::Migration
|
||||
class AddThreadCountsToCategories < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :categories, :threads_year, :integer
|
||||
add_column :categories, :threads_month, :integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddIconToExpressionTypes < ActiveRecord::Migration
|
||||
class AddIconToExpressionTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :expression_types, :icon, :string, limit: 20
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddAdminFlagToUsers < ActiveRecord::Migration
|
||||
class AddAdminFlagToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :admin, :boolean, default: false, null: false
|
||||
add_column :users, :moderator, :boolean, default: false, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddNewPasswordNewSaltEmailTokenToUsers < ActiveRecord::Migration
|
||||
class AddNewPasswordNewSaltEmailTokenToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :new_salt, :string, limit: 32
|
||||
add_column :users, :new_password_hash, :string, limit: 64
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveNewPasswordStuffFromUser < ActiveRecord::Migration
|
||||
class RemoveNewPasswordStuffFromUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :users, :new_password_hash
|
||||
remove_column :users, :new_salt
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateActions < ActiveRecord::Migration
|
||||
class CreateActions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :actions do |t|
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveSiteId < ActiveRecord::Migration
|
||||
class RemoveSiteId < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
drop_table 'sites'
|
||||
remove_index 'incoming_links', name: "incoming_index"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveForumId < ActiveRecord::Migration
|
||||
class RemoveForumId < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column 'forum_threads', 'forum_id'
|
||||
remove_column 'categories', 'forum_id'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CorrectIndexingOnPosts < ActiveRecord::Migration
|
||||
class CorrectIndexingOnPosts < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "update posts pp
|
||||
set post_number = c.real_number
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RemoveIndexForNow < ActiveRecord::Migration
|
||||
class RemoveIndexForNow < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_index "posts", ["forum_thread_id", "post_number"]
|
||||
add_index "posts", ["forum_thread_id", "post_number"], unique: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreatePostActions < ActiveRecord::Migration
|
||||
class CreatePostActions < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :post_actions do |t|
|
||||
t.integer :post_id, null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreatePostActionTypes < ActiveRecord::Migration
|
||||
class CreatePostActionTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table(:post_action_types, id: false) do |t|
|
||||
t.integer :id, options: "PRIMARY KEY", null: false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class MigrateBookmarksToPostActions < ActiveRecord::Migration
|
||||
class MigrateBookmarksToPostActions < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
drop_table "bookmarks"
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RenameActionsToUserActions < ActiveRecord::Migration
|
||||
class RenameActionsToUserActions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_table 'actions', 'user_actions'
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RetireExpressions < ActiveRecord::Migration
|
||||
class RetireExpressions < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute 'insert into post_actions (post_action_type_id, user_id, post_id, created_at, updated_at)
|
||||
select
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class RenameExpressionColumnsInForumThread < ActiveRecord::Migration
|
||||
class RenameExpressionColumnsInForumThread < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_column 'forum_threads', 'expression1_count', 'off_topic_count'
|
||||
rename_column 'forum_threads', 'expression2_count', 'offensive_count'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user