0b0e36e3cb
* show placeholder for hidden stackers in top * top rewardability views * make territory revenue idependent job * monthly rewards and leaderboard on rewards pages * fix earn reschedule * add query for rewards leaderboard * reduce likelihood of rewards racing with views * fix earn and refine values views
17 lines
408 B
PL/PgSQL
17 lines
408 B
PL/PgSQL
CREATE OR REPLACE FUNCTION schedule_territory_revenue()
|
|
RETURNS INTEGER
|
|
LANGUAGE plpgsql
|
|
AS $$
|
|
DECLARE
|
|
BEGIN
|
|
INSERT INTO pgboss.schedule (name, cron, timezone)
|
|
VALUES ('territoryRevenue', '0 0 * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
return 0;
|
|
EXCEPTION WHEN OTHERS THEN
|
|
return 0;
|
|
END;
|
|
$$;
|
|
|
|
SELECT schedule_territory_revenue();
|
|
DROP FUNCTION IF EXISTS create_territory_billing_job;
|