* Ran a MediaItem generator; Reformatted to my liking * [WIP] added basic index function * setup oban * Added basic Oban job for indexing * Added in workers for indexing; hooked them into record creation flow * Added a task model with a phx generator * Tied together tasks with jobs and channels
16 lines
505 B
Elixir
16 lines
505 B
Elixir
defmodule Pinchflat.Repo.Migrations.CreateTasks do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:tasks) do
|
|
add :job_id, references(:oban_jobs, on_delete: :delete_all), null: false
|
|
# `restrict` because we need to be sure to delete pending tasks when a channel is deleted
|
|
add :channel_id, references(:channels, on_delete: :restrict), null: true
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create index(:tasks, [:job_id])
|
|
create index(:tasks, [:channel_id])
|
|
end
|
|
end
|