Quantum Storage Adapter based on Ecto
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.2"}
]
end
Create a mew migration file with the following content:
defmodule MyApp.Repo.Migrations.AddIdToQuantumJobs do
use Ecto.Migration
def up do
QuantumStorageEcto.Migrations.V2AddIdToJob.up()
end
def down do
QuantumStorageEcto.Migrations.V2AddIdToJob.down()
end
end
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,
]
Create a mew migration file with the following content:
defmodule MyApp.Repo.Migrations.AddIdToQuantumJobs do
use Ecto.Migration
def up do
QuantumStorageEcto.Migrations.V2AddIdToJob.up()
end
def down do
QuantumStorageEcto.Migrations.V2AddIdToJob.down()
end
end
mix ecto.gen.migration adding_quantum_storage_ecto
defmodule MyApp.Repo.Migrations.AddQuantumJobs do
use Ecto.Migration
def up do
QuantumStorageEcto.Migrations.V1AddJobsTable.up()
QuantumStorageEcto.Migrations.V2AddIdToJob.up()
end
def down do
QuantumStorageEcto.Migrations.V1AddJobsTable.down()
QuantumStorageEcto.Migrations.V2AddIdToJob.down()
end
end
mix ecto.migrate
To run the full test suite:
mix test