init commit
This commit is contained in:
25
priv/repo/migrations/20240101000001_create_tasks.exs
Normal file
25
priv/repo/migrations/20240101000001_create_tasks.exs
Normal file
@@ -0,0 +1,25 @@
|
||||
defmodule WorkloadService.Repo.Migrations.CreateTasks do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:tasks, primary_key: false) do
|
||||
add :id, :string, primary_key: true
|
||||
add :org_id, :string, null: false
|
||||
add :application_id, :string, null: false
|
||||
add :provider_id, :string, null: false
|
||||
add :provider_name, :string
|
||||
add :task_info, :map, default: %{}
|
||||
add :submission, :map
|
||||
add :attachments, {:array, :string}, default: []
|
||||
add :status, :string, null: false, default: "created"
|
||||
add :version, :integer, default: 1
|
||||
|
||||
timestamps type: :utc_datetime
|
||||
end
|
||||
|
||||
create index(:tasks, [:application_id])
|
||||
create index(:tasks, [:org_id])
|
||||
create index(:tasks, [:provider_id])
|
||||
create index(:tasks, [:status])
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
defmodule WorkloadService.Repo.Migrations.CreateProjectionVersions do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:projection_versions, primary_key: false) do
|
||||
add(:projection_name, :text, primary_key: true)
|
||||
add(:last_seen_event_number, :bigint)
|
||||
|
||||
timestamps(type: :naive_datetime_usec)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user