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
19
priv/repo/migrations/20260712043533_create_review_stakes.exs
Normal file
19
priv/repo/migrations/20260712043533_create_review_stakes.exs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Tarakan.Repo.Migrations.CreateReviewStakes do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:review_stakes) do
|
||||
add :scan_id, references(:scans, on_delete: :delete_all), null: false
|
||||
# Denormalized submitter so reputation queries don't join back to scans.
|
||||
add :account_id, references(:accounts, on_delete: :delete_all), null: false
|
||||
add :amount, :integer, null: false
|
||||
|
||||
timestamps(type: :utc_datetime_usec)
|
||||
end
|
||||
|
||||
# One standing stake per review.
|
||||
create unique_index(:review_stakes, [:scan_id])
|
||||
create index(:review_stakes, [:account_id])
|
||||
create constraint(:review_stakes, :review_stakes_amount_positive, check: "amount >= 0")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue