append used Rails version to ActiveRecord::Migration

This commit is contained in:
Andreas Nedbal 2020-04-19 18:10:31 +02:00
parent eee7493c91
commit e1f775d955
51 changed files with 256 additions and 269 deletions

View File

@ -1,4 +1,4 @@
class CreateThemesTable < ActiveRecord::Migration
class CreateThemesTable < ActiveRecord::Migration[4.2]
def change
create_table :themes do |t|
end

View File

@ -1,4 +1,4 @@
class DeviseCreateUsers < ActiveRecord::Migration
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
## Database authenticatable

View File

@ -1,4 +1,4 @@
class AddScreenNameToUsers < ActiveRecord::Migration
class AddScreenNameToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :screen_name, :string
add_index :users, :screen_name, unique: true

View File

@ -1,4 +1,4 @@
class CreateQuestions < ActiveRecord::Migration
class CreateQuestions < ActiveRecord::Migration[4.2]
def change
create_table :questions do |t|
t.string :content

View File

@ -1,4 +1,4 @@
class CreateAnswers < ActiveRecord::Migration
class CreateAnswers < ActiveRecord::Migration[4.2]
def change
create_table :answers do |t|
t.string :content

View File

@ -1,4 +1,4 @@
class CreateComments < ActiveRecord::Migration
class CreateComments < ActiveRecord::Migration[4.2]
def change
create_table :comments do |t|
t.string :content

View File

@ -1,4 +1,4 @@
class AddCountsToUsers < ActiveRecord::Migration
class AddCountsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :friend_count, :integer, default: 0, null: false
add_column :users, :follower_count, :integer, default: 0, null: false

View File

@ -1,4 +1,4 @@
class AddDisplayNameToUsers < ActiveRecord::Migration
class AddDisplayNameToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :display_name, :string
end

View File

@ -1,4 +1,4 @@
class CreateInboxes < ActiveRecord::Migration
class CreateInboxes < ActiveRecord::Migration[4.2]
def change
create_table :inboxes do |t|
t.integer :user_id

View File

@ -1,4 +1,4 @@
class AddSmileCountToAnswers < ActiveRecord::Migration
class AddSmileCountToAnswers < ActiveRecord::Migration[4.2]
def change
add_column :answers, :smile_count, :integer, default: 0, null: false
end

View File

@ -1,4 +1,4 @@
class AddSmiledCountToUsers < ActiveRecord::Migration
class AddSmiledCountToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :smiled_count, :integer, default: 0, null: false
end

View File

@ -1,4 +1,4 @@
class AddAdminToUsers < ActiveRecord::Migration
class AddAdminToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :admin, :boolean, default: false, null: false
end

View File

@ -1,4 +1,4 @@
class AddMotivationHeaderToUsers < ActiveRecord::Migration
class AddMotivationHeaderToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :motivation_header, :string, default: '', null: false
end

View File

@ -1,4 +1,4 @@
class CreateRelationships < ActiveRecord::Migration
class CreateRelationships < ActiveRecord::Migration[4.2]
def change
create_table :relationships do |t|
t.integer :source_id

View File

@ -1,4 +1,4 @@
class CreateSmiles < ActiveRecord::Migration
class CreateSmiles < ActiveRecord::Migration[4.2]
def change
create_table :smiles do |t|
t.integer :user_id

View File

@ -1,4 +1,4 @@
class RenameColumnsInAnswers < ActiveRecord::Migration
class RenameColumnsInAnswers < ActiveRecord::Migration[4.2]
def change
rename_column :answers, :comments, :comment_count
remove_column :answers, :likes

View File

@ -1,4 +1,4 @@
class AddFieldsToUsers < ActiveRecord::Migration
class AddFieldsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :website, :string, default: '', null: false
add_column :users, :location, :string, default: '', null: false

View File

@ -1,4 +1,4 @@
class AddAnswerCountToQuestions < ActiveRecord::Migration
class AddAnswerCountToQuestions < ActiveRecord::Migration[4.2]
def change
add_column :questions, :answer_count, :integer, default: 0, null: false
end

View File

@ -1,4 +1,4 @@
class ChangeAnswerContentColumnType < ActiveRecord::Migration
class ChangeAnswerContentColumnType < ActiveRecord::Migration[4.2]
def change
change_table :answers do |t|
t.change :content, :text

View File

@ -1,4 +1,4 @@
class CreateServices < ActiveRecord::Migration
class CreateServices < ActiveRecord::Migration[4.2]
def change
create_table :services do |t|
t.string :type, null: false

View File

@ -1,4 +1,4 @@
class CreateNotifications < ActiveRecord::Migration
class CreateNotifications < ActiveRecord::Migration[4.2]
def change
create_table :notifications do |t|
t.string :target_type

View File

@ -1,4 +1,4 @@
class AddModeratorToUsers < ActiveRecord::Migration
class AddModeratorToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :moderator, :boolean, default: false, null: false
end

View File

@ -1,4 +1,4 @@
class CreateReports < ActiveRecord::Migration
class CreateReports < ActiveRecord::Migration[4.2]
def change
create_table :reports do |t|
t.string :type, null: false

View File

@ -1,4 +1,4 @@
class CreateModerationVotes < ActiveRecord::Migration
class CreateModerationVotes < ActiveRecord::Migration[4.2]
def change
create_table :moderation_votes do |t|
t.integer :report_id, null: false

View File

@ -1,4 +1,4 @@
class CreateModerationComments < ActiveRecord::Migration
class CreateModerationComments < ActiveRecord::Migration[4.2]
def change
create_table :moderation_comments do |t|
t.integer :report_id

View File

@ -1,4 +1,4 @@
class AddDeletedToReports < ActiveRecord::Migration
class AddDeletedToReports < ActiveRecord::Migration[4.2]
def change
add_column :reports, :deleted, :boolean, default: false
end

View File

@ -1,4 +1,4 @@
class AddAttachmentProfilePictureToUsers < ActiveRecord::Migration
class AddAttachmentProfilePictureToUsers < ActiveRecord::Migration[4.2]
def self.up
change_table :users do |t|
t.attachment :profile_picture

View File

@ -1,4 +1,4 @@
class AddProfilePictureProcessingToUsers < ActiveRecord::Migration
class AddProfilePictureProcessingToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :profile_picture_processing, :boolean
end

View File

@ -1,4 +1,4 @@
class AddCropValuesToUsers < ActiveRecord::Migration
class AddCropValuesToUsers < ActiveRecord::Migration[4.2]
def change
# this is a ugly hack and will stay until I find a way to pass parameters
# to the paperclip Sidekiq worker. oh well.

View File

@ -1,4 +1,4 @@
class AddSupporterToUsers < ActiveRecord::Migration
class AddSupporterToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :supporter, :boolean, default: false
end

View File

@ -1,4 +1,4 @@
class AddPrivacyOptionsToUsers < ActiveRecord::Migration
class AddPrivacyOptionsToUsers < ActiveRecord::Migration[4.2]
def change
%i{
privacy_allow_anonymous_questions

View File

@ -1,4 +1,4 @@
class AddBannedToUsers < ActiveRecord::Migration
class AddBannedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :banned, :boolean, default: false
end

View File

@ -1,4 +1,4 @@
class CreateGroups < ActiveRecord::Migration
class CreateGroups < ActiveRecord::Migration[4.2]
def change
create_table :groups do |t|
t.integer :user_id, null: false

View File

@ -1,4 +1,4 @@
class AddBloggerToUsers < ActiveRecord::Migration
class AddBloggerToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :blogger, :boolean, default: :false
end

View File

@ -1,4 +1,4 @@
class AddContributorToUsers < ActiveRecord::Migration
class AddContributorToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :contributor, :boolean, default: :false
end

View File

@ -1,4 +1,4 @@
class CreateSubscriptions < ActiveRecord::Migration
class CreateSubscriptions < ActiveRecord::Migration[4.2]
def change
create_table :subscriptions do |t|
t.integer :user_id, null: false

View File

@ -1,4 +1,4 @@
class AddIsActiveToSubscriptions < ActiveRecord::Migration
class AddIsActiveToSubscriptions < ActiveRecord::Migration[4.2]
def change
add_column :subscriptions, :is_active, :boolean, default: :true
end

View File

@ -1,4 +1,4 @@
class AddReasonToReport < ActiveRecord::Migration
class AddReasonToReport < ActiveRecord::Migration[4.2]
def change
add_column :reports, :reason, :string, default: nil
end

View File

@ -1,4 +1,4 @@
class RenameBannedToPermanentlyBannedInUsers < ActiveRecord::Migration
class RenameBannedToPermanentlyBannedInUsers < ActiveRecord::Migration[4.2]
def up
rename_column :users, :banned, :permanently_banned
end

View File

@ -1,4 +1,4 @@
class AddBanReasonAndBannedUntilToUsers < ActiveRecord::Migration
class AddBanReasonAndBannedUntilToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :ban_reason, :string, default: nil
add_column :users, :banned_until, :datetime, default: nil

View File

@ -1,4 +1,4 @@
class CreateCommentSmiles < ActiveRecord::Migration
class CreateCommentSmiles < ActiveRecord::Migration[4.2]
def change
create_table :comment_smiles do |t|
t.integer :user_id

View File

@ -1,4 +1,4 @@
class AddAttachmentProfileHeaderToUsers < ActiveRecord::Migration
class AddAttachmentProfileHeaderToUsers < ActiveRecord::Migration[4.2]
def change
change_table :users do |t|
t.attachment :profile_header

View File

@ -1,4 +1,4 @@
class AddLocaleToUser < ActiveRecord::Migration
class AddLocaleToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :locale, :string
end

View File

@ -1,4 +1,4 @@
class AddTranslatorToUsers < ActiveRecord::Migration
class AddTranslatorToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :translator, :boolean, default: :false
end

View File

@ -1,4 +1,4 @@
class ChangeDefaultValueOfLocale < ActiveRecord::Migration
class ChangeDefaultValueOfLocale < ActiveRecord::Migration[4.2]
def change
change_column :users, :locale, :string, :default => 'en'
end

View File

@ -1,4 +1,4 @@
class AddConfirmableToDevise < ActiveRecord::Migration
class AddConfirmableToDevise < ActiveRecord::Migration[4.2]
def up
add_column :users, :confirmation_token, :string
add_column :users, :confirmed_at, :datetime

View File

@ -1,4 +1,4 @@
class CreateThemes < ActiveRecord::Migration
class CreateThemes < ActiveRecord::Migration[4.2]
def change
create_table :themes do |t|
t.integer :user_id, null: false

View File

@ -1,4 +1,4 @@
class AddShowForeignThemesToUsers < ActiveRecord::Migration
class AddShowForeignThemesToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :show_foreign_themes, :boolean, default: true, null: false
end

View File

@ -1,4 +1,4 @@
class AddInputAndOutlineToTheme < ActiveRecord::Migration
class AddInputAndOutlineToTheme < ActiveRecord::Migration[4.2]
def change
add_column :themes, :input_color, :integer, default: 0xFFFFFF, null: false
add_column :themes, :input_text, :integer, default: 0x000000, null: false

View File

@ -1,4 +1,4 @@
class AddExportFieldsToUsers < ActiveRecord::Migration
class AddExportFieldsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :export_url, :string
add_column :users, :export_processing, :boolean, default: false, null: false

View File

@ -1,4 +1,3 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@ -11,12 +10,12 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160105165913) do
ActiveRecord::Schema.define(version: 2016_01_05_165913) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "answers", force: :cascade do |t|
create_table "answers", id: :serial, force: :cascade do |t|
t.text "content"
t.integer "question_id"
t.integer "comment_count", default: 0, null: false
@ -24,57 +23,52 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.datetime "created_at"
t.datetime "updated_at"
t.integer "smile_count", default: 0, null: false
t.index ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at"
end
add_index "answers", ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at", using: :btree
create_table "comment_smiles", force: :cascade do |t|
create_table "comment_smiles", id: :serial, force: :cascade do |t|
t.integer "user_id"
t.integer "comment_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["comment_id"], name: "index_comment_smiles_on_comment_id"
t.index ["user_id", "comment_id"], name: "index_comment_smiles_on_user_id_and_comment_id", unique: true
t.index ["user_id"], name: "index_comment_smiles_on_user_id"
end
add_index "comment_smiles", ["comment_id"], name: "index_comment_smiles_on_comment_id", using: :btree
add_index "comment_smiles", ["user_id", "comment_id"], name: "index_comment_smiles_on_user_id_and_comment_id", unique: true, using: :btree
add_index "comment_smiles", ["user_id"], name: "index_comment_smiles_on_user_id", using: :btree
create_table "comments", force: :cascade do |t|
create_table "comments", id: :serial, force: :cascade do |t|
t.string "content"
t.integer "answer_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "smile_count", default: 0, null: false
t.index ["user_id", "created_at"], name: "index_comments_on_user_id_and_created_at"
end
add_index "comments", ["user_id", "created_at"], name: "index_comments_on_user_id_and_created_at", using: :btree
create_table "group_members", force: :cascade do |t|
create_table "group_members", id: :serial, force: :cascade do |t|
t.integer "group_id", null: false
t.integer "user_id", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.index ["group_id", "user_id"], name: "index_group_members_on_group_id_and_user_id", unique: true
t.index ["group_id"], name: "index_group_members_on_group_id"
t.index ["user_id"], name: "index_group_members_on_user_id"
end
add_index "group_members", ["group_id", "user_id"], name: "index_group_members_on_group_id_and_user_id", unique: true, using: :btree
add_index "group_members", ["group_id"], name: "index_group_members_on_group_id", using: :btree
add_index "group_members", ["user_id"], name: "index_group_members_on_user_id", using: :btree
create_table "groups", force: :cascade do |t|
create_table "groups", id: :serial, force: :cascade do |t|
t.integer "user_id", null: false
t.string "name"
t.string "display_name"
t.boolean "private", default: true
t.datetime "created_at"
t.datetime "updated_at"
t.index ["name"], name: "index_groups_on_name"
t.index ["user_id", "name"], name: "index_groups_on_user_id_and_name", unique: true
t.index ["user_id"], name: "index_groups_on_user_id"
end
add_index "groups", ["name"], name: "index_groups_on_name", using: :btree
add_index "groups", ["user_id", "name"], name: "index_groups_on_user_id_and_name", unique: true, using: :btree
add_index "groups", ["user_id"], name: "index_groups_on_user_id", using: :btree
create_table "inboxes", force: :cascade do |t|
create_table "inboxes", id: :serial, force: :cascade do |t|
t.integer "user_id"
t.integer "question_id"
t.boolean "new"
@ -82,29 +76,27 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.datetime "updated_at"
end
create_table "moderation_comments", force: :cascade do |t|
create_table "moderation_comments", id: :serial, force: :cascade do |t|
t.integer "report_id"
t.integer "user_id"
t.string "content"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["user_id", "created_at"], name: "index_moderation_comments_on_user_id_and_created_at"
end
add_index "moderation_comments", ["user_id", "created_at"], name: "index_moderation_comments_on_user_id_and_created_at", using: :btree
create_table "moderation_votes", force: :cascade do |t|
create_table "moderation_votes", id: :serial, force: :cascade do |t|
t.integer "report_id", null: false
t.integer "user_id", null: false
t.boolean "upvote", default: false, null: false
t.datetime "created_at"
t.datetime "updated_at"
t.index ["report_id"], name: "index_moderation_votes_on_report_id"
t.index ["user_id", "report_id"], name: "index_moderation_votes_on_user_id_and_report_id", unique: true
t.index ["user_id"], name: "index_moderation_votes_on_user_id"
end
add_index "moderation_votes", ["report_id"], name: "index_moderation_votes_on_report_id", using: :btree
add_index "moderation_votes", ["user_id", "report_id"], name: "index_moderation_votes_on_user_id_and_report_id", unique: true, using: :btree
add_index "moderation_votes", ["user_id"], name: "index_moderation_votes_on_user_id", using: :btree
create_table "notifications", force: :cascade do |t|
create_table "notifications", id: :serial, force: :cascade do |t|
t.string "target_type"
t.integer "target_id"
t.integer "recipient_id"
@ -113,7 +105,7 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.datetime "updated_at"
end
create_table "questions", force: :cascade do |t|
create_table "questions", id: :serial, force: :cascade do |t|
t.string "content"
t.boolean "author_is_anonymous"
t.string "author_name"
@ -122,22 +114,20 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.datetime "created_at"
t.datetime "updated_at"
t.integer "answer_count", default: 0, null: false
t.index ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at"
end
add_index "questions", ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at", using: :btree
create_table "relationships", force: :cascade do |t|
create_table "relationships", id: :serial, force: :cascade do |t|
t.integer "source_id"
t.integer "target_id"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["source_id", "target_id"], name: "index_relationships_on_source_id_and_target_id", unique: true
t.index ["source_id"], name: "index_relationships_on_source_id"
t.index ["target_id"], name: "index_relationships_on_target_id"
end
add_index "relationships", ["source_id", "target_id"], name: "index_relationships_on_source_id_and_target_id", unique: true, using: :btree
add_index "relationships", ["source_id"], name: "index_relationships_on_source_id", using: :btree
add_index "relationships", ["target_id"], name: "index_relationships_on_target_id", using: :btree
create_table "reports", force: :cascade do |t|
create_table "reports", id: :serial, force: :cascade do |t|
t.string "type", null: false
t.integer "target_id", null: false
t.integer "user_id", null: false
@ -147,7 +137,7 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.string "reason"
end
create_table "services", force: :cascade do |t|
create_table "services", id: :serial, force: :cascade do |t|
t.string "type", null: false
t.integer "user_id", null: false
t.string "uid"
@ -158,18 +148,17 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.datetime "updated_at"
end
create_table "smiles", force: :cascade do |t|
create_table "smiles", id: :serial, force: :cascade do |t|
t.integer "user_id"
t.integer "answer_id"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["answer_id"], name: "index_smiles_on_answer_id"
t.index ["user_id", "answer_id"], name: "index_smiles_on_user_id_and_answer_id", unique: true
t.index ["user_id"], name: "index_smiles_on_user_id"
end
add_index "smiles", ["answer_id"], name: "index_smiles_on_answer_id", using: :btree
add_index "smiles", ["user_id", "answer_id"], name: "index_smiles_on_user_id_and_answer_id", unique: true, using: :btree
add_index "smiles", ["user_id"], name: "index_smiles_on_user_id", using: :btree
create_table "subscriptions", force: :cascade do |t|
create_table "subscriptions", id: :serial, force: :cascade do |t|
t.integer "user_id", null: false
t.integer "answer_id", null: false
t.datetime "created_at", null: false
@ -177,7 +166,7 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.boolean "is_active", default: true
end
create_table "themes", force: :cascade do |t|
create_table "themes", id: :serial, force: :cascade do |t|
t.integer "user_id", null: false
t.integer "primary_color", default: 6174129
t.integer "primary_text", default: 16777215
@ -206,11 +195,10 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.integer "input_color", default: 16777215, null: false
t.integer "input_text", default: 0, null: false
t.integer "outline_color", default: 6174129, null: false
t.index ["user_id", "created_at"], name: "index_themes_on_user_id_and_created_at"
end
add_index "themes", ["user_id", "created_at"], name: "index_themes_on_user_id_and_created_at", using: :btree
create_table "users", force: :cascade do |t|
create_table "users", id: :serial, force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
@ -276,11 +264,10 @@ ActiveRecord::Schema.define(version: 20160105165913) do
t.string "export_url"
t.boolean "export_processing", default: false, null: false
t.datetime "export_created_at"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["screen_name"], name: "index_users_on_screen_name", unique: true
end
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_index "users", ["screen_name"], name: "index_users_on_screen_name", unique: true, using: :btree
end