graphile / graphile/migrate

how to use with graphile-worker

Open
#178 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
835
Forks
64
Avg merge
17m
Merged PRs (30d)
5

Description

### Summary

I am using graphile-worker and am unsure how to mesh them together

```js
// .gmrc.js
{
afterReset: [
{
_: 'command',
command:
'DATABASE_URL="$OWNER_DATABASE_URL" npx --no-install graphile-worker --schema-only',
shadow: false,
},
{
_: 'command',
command:
'DATABASE_URL="$SHADOW_DATABASE_URL" npx --no-install graphile-worker --schema-only',
shadow: true,
},
],
...
}
```

seems to get the job done but is this future proof or is there a better way?

If for example i have the following migration
```sql
create or replace function app_private.add_job(identifier text, payload json DEFAULT NULL::json, queue_name text DEFAULT NULL::text, run_at timestamp with time zone DEFAULT NULL::timestamp with time zone, max_attempts integer DEFAULT NULL::integer, job_key text DEFAULT NULL::text, priority integer DEFAULT NULL::integer, flags text[] DEFAULT NULL::text[], job_key_mode text DEFAULT 'replace'::text) RETURNS graphile_worker.jobs as $$
select graphile_worker.add_job(identifier, payload, queue_name, run_at, max_attempts, job_key, priority , flags, job_key_mode);
$$ language sql security definer;
```

and in the future graphile-worker changes `add_job` or `jobs` would the migration fail? is there a way around it?

Either way mentioning the way to integrate with graphile-worker in the readme would be nice.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.