diff options
Diffstat (limited to 'schema/pgsql-migrations/upgrade_94.sql')
-rw-r--r-- | schema/pgsql-migrations/upgrade_94.sql | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/schema/pgsql-migrations/upgrade_94.sql b/schema/pgsql-migrations/upgrade_94.sql new file mode 100644 index 0000000..5341a8b --- /dev/null +++ b/schema/pgsql-migrations/upgrade_94.sql @@ -0,0 +1,34 @@ +CREATE TABLE director_job ( + id serial, + job_name character varying(64) NOT NULL, + job_class character varying(72) NOT NULL, + disabled enum_boolean NOT NULL DEFAULT 'n', + run_interval integer NOT NULL, -- seconds + last_attempt_succeeded enum_boolean DEFAULT NULL, + ts_last_attempt timestamp with time zone DEFAULT NULL, + ts_last_error timestamp with time zone DEFAULT NULL, + last_error_message text NULL DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE UNIQUE INDEX director_job_unique_job_name ON director_job (job_name); + + +CREATE TABLE director_job_setting ( + job_id integer NOT NULL, + setting_name character varying(64) NOT NULL, + setting_value text DEFAULT NULL, + PRIMARY KEY (job_id, setting_name), + CONSTRAINT director_job_setting_job + FOREIGN KEY (job_id) + REFERENCES director_job (id) + ON DELETE CASCADE + ON UPDATE CASCADE +); + +CREATE INDEX director_job_setting_job ON director_job_setting (job_id); + + +INSERT INTO director_schema_migration + (schema_version, migration_time) + VALUES (94, NOW()); |