Merge commit 'eaa1f9e450
' into kb_migration
This commit is contained in:
commit
2a813d517d
73 changed files with 987 additions and 72 deletions
12
db/migrate/20230705232953_create_status_references.rb
Normal file
12
db/migrate/20230705232953_create_status_references.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateStatusReferences < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :status_references do |t|
|
||||
t.belongs_to :status, null: false, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :target_status, null: false, foreign_key: { on_delete: :cascade, to_table: :statuses }
|
||||
t.datetime :created_at, null: false
|
||||
t.datetime :updated_at, null: false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddStatusReferredByCountToStatusStats < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
safety_assured do
|
||||
add_column :status_stats, :status_referred_by_count, :integer, null: false, default: 0
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :status_stats, :status_referred_by_count
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue