View Source QuantumStorageEcto (Quantum Storage Ecto v0.1.0)
A storage adapter for Quantum
based on Ecto
Installation
The package can be installed by adding quantum_storage_ecto
to your list of dependencies in mix.exs:
def deps do
[{:quantum_storage_ecto, "~> 0.1.0"}]
end
How to Use?
Simply add QuantumStorageEcto
in Quantum
config and run the required migrations.
The Repo
(Ecto.Repo
) parameter is required and is used to communicate with the database
config :my_app, MyApp.Scheduler,
storage: QuantumStorageEcto,
storage_opts: [
repo: MyApp.Repo,
]
Running the migrations
Create a new migration file in your application
mix ecto.gen.migration adding_quantum_storage_ecto
Edit the newly created migration file
defmodule MyApp.Repo.Migrations.AddQuantumJobs do
use Ecto.Migration
def up do
QuantumStorageEcto.Migrations.V1AddJobsTable.up()
end
def down do
QuantumStorageEcto.Migrations.V1AddJobsTable.down()
end
end
Migrate
mix ecto.migrate
Database Tables
The adapter creates 2 database tables:
quantum_jobs
- this table stores the job definitionsquantum_last_execution_date
- holds the last execution data