backie/migrations/2021-07-24-050243_create_fang_periodic_tasks/up.sql
Ayrat Badykov 7d92fd2d6a
Update Readme (#7)
* Update Readme

* change migration path in the readme
2021-07-24 12:13:59 +03:00

11 lines
490 B
SQL

CREATE TABLE fang_periodic_tasks (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
metadata jsonb NOT NULL,
period_in_seconds INTEGER 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);