1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/stable-4.3' into kb-draft-15.0-lts

This commit is contained in:
KMY 2024-10-09 07:48:54 +09:00
commit eff82af854
103 changed files with 1199 additions and 762 deletions

View file

@ -0,0 +1,39 @@
# frozen_string_literal: true
class FixNotificationPermissionForeignKeys < ActiveRecord::Migration[7.1]
def up
safety_assured do
execute <<~SQL.squish
ALTER TABLE notification_permissions
DROP CONSTRAINT fk_rails_7c0bed08df,
ADD CONSTRAINT fk_rails_7c0bed08df
FOREIGN KEY (account_id)
REFERENCES accounts(id)
ON DELETE CASCADE,
DROP CONSTRAINT fk_rails_e3e0aaad70,
ADD CONSTRAINT fk_rails_e3e0aaad70
FOREIGN KEY (from_account_id)
REFERENCES accounts(id)
ON DELETE CASCADE
SQL
end
end
def down
safety_assured do
execute <<~SQL.squish
ALTER TABLE notification_permissions
DROP CONSTRAINT fk_rails_7c0bed08df,
ADD CONSTRAINT fk_rails_7c0bed08df
FOREIGN KEY (account_id)
REFERENCES accounts(id),
DROP CONSTRAINT fk_rails_e3e0aaad70,
ADD CONSTRAINT fk_rails_e3e0aaad70
FOREIGN KEY (from_account_id)
REFERENCES accounts(id)
SQL
end
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_09_16_190140) do
ActiveRecord::Schema[7.1].define(version: 2024_10_07_071624) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -1684,8 +1684,8 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_16_190140) do
add_foreign_key "mutes", "accounts", name: "fk_b8d8daf315", on_delete: :cascade
add_foreign_key "ng_rule_histories", "accounts"
add_foreign_key "ng_rule_histories", "ng_rules"
add_foreign_key "notification_permissions", "accounts"
add_foreign_key "notification_permissions", "accounts", column: "from_account_id"
add_foreign_key "notification_permissions", "accounts", column: "from_account_id", on_delete: :cascade
add_foreign_key "notification_permissions", "accounts", on_delete: :cascade
add_foreign_key "notification_policies", "accounts", on_delete: :cascade
add_foreign_key "notification_requests", "accounts", column: "from_account_id", on_delete: :cascade
add_foreign_key "notification_requests", "accounts", on_delete: :cascade