Initial commit on Forgejo
Fresh repository history for elektrine/tarakan hosted at https://git.elektrine.com/elektrine/tarakan.
This commit is contained in:
commit
af6077b9c3
455 changed files with 78366 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
defmodule Tarakan.Repo.Migrations.LinkReviewTasksAndScans do
|
||||
@moduledoc """
|
||||
Additive FKs for the Review/Request domain collapse (PR 1a).
|
||||
|
||||
- `review_tasks.linked_review_id` → the latest Review created when completing a Request
|
||||
- `scans.source_request_id` → the Request that produced this Review (history of attempts)
|
||||
|
||||
No application behavior change in this migration. Both columns are nullable so
|
||||
existing rows and ad-hoc Reviews remain valid.
|
||||
"""
|
||||
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:scans) do
|
||||
add :source_request_id, references(:review_tasks, on_delete: :nilify_all)
|
||||
end
|
||||
|
||||
alter table(:review_tasks) do
|
||||
add :linked_review_id, references(:scans, on_delete: :nilify_all)
|
||||
end
|
||||
|
||||
create index(:scans, [:source_request_id])
|
||||
create index(:review_tasks, [:linked_review_id])
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue