Production VS Staging with different table entries #682
Unanswered
marksie1988
asked this question in
Q&A
Replies: 1 comment
-
Can you use variables? Something like:
Then use the variable for your engine. For Postgres, it'd be something like: INSERT INTO cron_jobs VALUES (:'cron_entries'); Another option is to set a variable for your environment then write a conditional in the deploy script. Something like:
Then in the deploy script, do something like this (assuming Postgres here, just typed in, not tested): DO $$
DECLARE env TEXT := $$ || :'env' || $$
BEGIN
IF env = 'prd' THEN
INSERT INTO cron_jobs (prd stuff);
ELSE
INSERT INTO cron_jobs (stg stuff);
END IF;
END;
$$;
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I have a production and staging environment, in both there is a table
cron_jobs
however the cron jobs have different settings if they are in production vs staging.e.g. one job may run on Tuesday on production but Wednesday in staging. or the job might be disabled in staging and enabled in production.
Each cron job has a single line entry with its settings which means I need a way to say:
My question is, how would I achieve this?
Beta Was this translation helpful? Give feedback.
All reactions