backie/migrations/2021-07-24-050243_create_fang_periodic_tasks/up.sql
Pmarquez 1dc513c4a7
Sleep with Duration (#67)
* Sleep in millis

* SleepParams Duration :D

* Readme updated!

* Changing Schedule and SleepParams to std::time::Duration

* Millis period in Periodic tasks

* Readme!

* Error management

* period_in_millis i64

* fix clippy
2022-08-18 14:39:10 +03:00

11 lines
488 B
SQL

CREATE TABLE fang_periodic_tasks (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
metadata jsonb NOT NULL,
period_in_millis BIGINT NOT NULL,
scheduled_at TIMESTAMP WITH TIME ZONE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
CREATE INDEX fang_periodic_tasks_scheduled_at_index ON fang_periodic_tasks(scheduled_at);
CREATE INDEX fang_periodic_tasks_metadata_index ON fang_periodic_tasks(metadata);