[][src]Function coil::migrate

pub async fn migrate<'_>(
    pool: impl Acquire<'_, Database = Postgres>
) -> Result<(), Error>

Run the migrations for the background tasks. This creates a table _background_tasks which stores the tasks for execution

CREATE TABLE _background_tasks (
 id BIGSERIAL PRIMARY KEY NOT NULL,
 job_type TEXT NOT NULL,
 data BYTEA NOT NULL,
 is_async BOOLEAN NOT NULL,
 retries INTEGER NOT NULL DEFAULT 0,
 last_retry TIMESTAMP NOT NULL DEFAULT '1970-01-01',
 created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);