1
0
Fork 0
forked from gitea/nas

Add notification policies and notification requests (#29366)

This commit is contained in:
Eugen Rochko 2024-03-07 15:53:37 +01:00 committed by GitHub
parent 653ce43abe
commit 50b17f7e10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
104 changed files with 1096 additions and 247 deletions

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
class CreateNotificationRequests < ActiveRecord::Migration[7.1]
def change
create_table :notification_requests do |t|
t.references :account, null: false, foreign_key: { on_delete: :cascade }, index: false
t.references :from_account, null: false, foreign_key: { to_table: :accounts, on_delete: :cascade }
t.references :last_status, null: false, foreign_key: { to_table: :statuses, on_delete: :nullify }
t.bigint :notifications_count, null: false, default: 0
t.boolean :dismissed, null: false, default: false
t.timestamps
end
add_index :notification_requests, [:account_id, :from_account_id], unique: true
add_index :notification_requests, [:account_id, :id], where: 'dismissed = false', order: { id: :desc }
end
end