493 B · text History b868907
defmodule GitGud.Repo.Migrations.CreateWorkflowSchedules do
  use Ecto.Migration

  def change do
    create table(:workflow_schedules) do
      add :repository_id, references(:repositories, on_delete: :delete_all), null: false
      add :workflow_path, :text, null: false
      add :cron, :text, null: false
      add :last_fired_at, :utc_datetime

      timestamps(type: :utc_datetime)
    end

    create unique_index(:workflow_schedules, [:repository_id, :workflow_path, :cron])
  end
end