From c7418b5de7071d84aa01ecd1a51df400d4470b6d Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 20 Aug 2022 18:35:00 +0200 Subject: [PATCH] Make `user_id` on `anonymous_blocks` nullable --- ...3035_make_user_id_on_anonymous_blocks_nullable.rb | 7 +++++++ db/schema.rb | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20220820163035_make_user_id_on_anonymous_blocks_nullable.rb diff --git a/db/migrate/20220820163035_make_user_id_on_anonymous_blocks_nullable.rb b/db/migrate/20220820163035_make_user_id_on_anonymous_blocks_nullable.rb new file mode 100644 index 00000000..046fb385 --- /dev/null +++ b/db/migrate/20220820163035_make_user_id_on_anonymous_blocks_nullable.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class MakeUserIdOnAnonymousBlocksNullable < ActiveRecord::Migration[6.1] + def change + change_column_null :anonymous_blocks, :user_id, true + end +end diff --git a/db/schema.rb b/db/schema.rb index 140139e5..3f035379 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_07_20_190421) do +ActiveRecord::Schema.define(version: 2022_08_20_163035) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -46,6 +46,8 @@ ActiveRecord::Schema.define(version: 2022_07_20_190421) do t.datetime "created_at" t.datetime "updated_at" t.integer "smile_count", default: 0, null: false + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_answers_on_deleted_at" t.index ["question_id"], name: "index_answers_on_question_id" t.index ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at" end @@ -58,6 +60,8 @@ ActiveRecord::Schema.define(version: 2022_07_20_190421) do t.text "content" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_appendables_on_deleted_at" t.index ["parent_id", "parent_type"], name: "index_appendables_on_parent_id_and_parent_type" t.index ["user_id", "created_at"], name: "index_appendables_on_user_id_and_created_at" end @@ -69,7 +73,9 @@ ActiveRecord::Schema.define(version: 2022_07_20_190421) do t.datetime "created_at" t.datetime "updated_at" t.integer "smile_count", default: 0, null: false + t.datetime "deleted_at" t.index ["answer_id"], name: "index_comments_on_answer_id" + t.index ["deleted_at"], name: "index_comments_on_deleted_at" t.index ["user_id", "created_at"], name: "index_comments_on_user_id_and_created_at" end @@ -144,6 +150,8 @@ ActiveRecord::Schema.define(version: 2022_07_20_190421) do t.datetime "updated_at" t.integer "answer_count", default: 0, null: false t.boolean "direct", default: false, null: false + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_questions_on_deleted_at" t.index ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at" end @@ -292,7 +300,9 @@ ActiveRecord::Schema.define(version: 2022_07_20_190421) do t.datetime "export_created_at" t.string "otp_secret_key" t.integer "otp_module", default: 0, null: false + t.datetime "deleted_at" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true + t.index ["deleted_at"], name: "index_users_on_deleted_at" 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