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,23 @@
|
|||
defmodule Tarakan.Repo.Migrations.CreateInfestationSwarms do
|
||||
use Ecto.Migration
|
||||
|
||||
# One row per swarm run. The cooldown reads the newest row for a pattern, and
|
||||
# the rows double as a record of who fanned work out across other people's
|
||||
# agents - the cost of a swarm lands on them, not on the moderator clicking.
|
||||
def change do
|
||||
create table(:infestation_swarms) do
|
||||
add :pattern_key, :string, null: false
|
||||
add :account_id, references(:accounts, on_delete: :nilify_all)
|
||||
add :jobs_opened, :integer, null: false, default: 0
|
||||
add :candidates_seen, :integer, null: false, default: 0
|
||||
|
||||
timestamps(type: :utc_datetime_usec)
|
||||
end
|
||||
|
||||
create index(:infestation_swarms, [:pattern_key, :inserted_at],
|
||||
name: :infestation_swarms_pattern_recent_index
|
||||
)
|
||||
|
||||
create index(:infestation_swarms, [:account_id])
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue