From f7037644f02a3099b63c135643769aa8f3f157e4 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Thu, 16 Jan 2020 18:25:25 -0500 Subject: [PATCH] Don't use ForeignKey for User.last_read_notification https://gitlab.com/soapbox-pub/soapbox/commit/dc7bc17267d68f6e9d15830390d41dc07047489a --- ..._foreign_key_constraint_to_user_last_read_notification.rb | 5 +++++ db/schema.rb | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20191202004114_remove_foreign_key_constraint_to_user_last_read_notification.rb diff --git a/db/migrate/20191202004114_remove_foreign_key_constraint_to_user_last_read_notification.rb b/db/migrate/20191202004114_remove_foreign_key_constraint_to_user_last_read_notification.rb new file mode 100644 index 00000000..d9efb022 --- /dev/null +++ b/db/migrate/20191202004114_remove_foreign_key_constraint_to_user_last_read_notification.rb @@ -0,0 +1,5 @@ +class RemoveForeignKeyConstraintToUserLastReadNotification < ActiveRecord::Migration[5.2] + def change + remove_foreign_key :users, column: :last_read_notification + end +end diff --git a/db/schema.rb b/db/schema.rb index 13cc5f60..3d8c22ab 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: 2019_12_01_210057) do +ActiveRecord::Schema.define(version: 2019_12_02_004114) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -935,7 +935,6 @@ ActiveRecord::Schema.define(version: 2019_12_01_210057) do add_foreign_key "user_invite_requests", "users", on_delete: :cascade add_foreign_key "users", "accounts", name: "fk_50500f500d", on_delete: :cascade add_foreign_key "users", "invites", on_delete: :nullify - add_foreign_key "users", "notifications", column: "last_read_notification", on_delete: :nullify add_foreign_key "users", "oauth_applications", column: "created_by_application_id", on_delete: :nullify add_foreign_key "web_push_subscriptions", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade add_foreign_key "web_push_subscriptions", "users", on_delete: :cascade