forked from gitpan/TheSchwartz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Peatix/ggunson-schema-update
Update schema.sql to match production
- Loading branch information
Showing
1 changed file
with
48 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,57 @@ | ||
CREATE TABLE funcmap ( | ||
funcid INT UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT, | ||
funcname VARCHAR(255) NOT NULL, | ||
UNIQUE(funcname) | ||
); | ||
funcid int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
funcname varchar(255) NOT NULL, | ||
PRIMARY KEY (funcid), | ||
UNIQUE KEY funcname (funcname) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE job ( | ||
jobid BIGINT UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT, | ||
funcid INT UNSIGNED NOT NULL, | ||
arg MEDIUMBLOB, | ||
uniqkey VARCHAR(255) NULL, | ||
insert_time INTEGER UNSIGNED, | ||
run_after INTEGER UNSIGNED NOT NULL, | ||
grabbed_until INTEGER UNSIGNED NOT NULL, | ||
priority SMALLINT UNSIGNED, | ||
coalesce VARCHAR(255), | ||
INDEX (funcid, run_after), | ||
UNIQUE(funcid, uniqkey), | ||
INDEX (funcid, coalesce) | ||
); | ||
jobid bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
funcid int(10) unsigned NOT NULL, | ||
arg mediumblob, | ||
uniqkey varchar(255) DEFAULT NULL, | ||
insert_time int(10) unsigned DEFAULT NULL, | ||
run_after int(10) unsigned NOT NULL, | ||
grabbed_until int(10) unsigned NOT NULL, | ||
priority smallint(5) unsigned DEFAULT NULL, | ||
coalesce varchar(255) DEFAULT NULL, | ||
PRIMARY KEY (jobid), | ||
UNIQUE KEY funcid_2 (funcid,uniqkey), | ||
KEY funcid (funcid,run_after), | ||
KEY funcid_3 (funcid,coalesce), | ||
KEY idx_run_after_grabbed_until (run_after,grabbed_until), | ||
KEY idx_coalesce (coalesce) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE note ( | ||
jobid BIGINT UNSIGNED NOT NULL, | ||
notekey VARCHAR(255), | ||
PRIMARY KEY (jobid, notekey), | ||
value MEDIUMBLOB | ||
); | ||
jobid bigint(20) unsigned NOT NULL, | ||
notekey varchar(255) NOT NULL DEFAULT '', | ||
value mediumblob, | ||
PRIMARY KEY (jobid,notekey) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE error ( | ||
error_time INTEGER UNSIGNED NOT NULL, | ||
jobid BIGINT UNSIGNED NOT NULL, | ||
message MEDIUMTEXT NOT NULL, | ||
funcid INT UNSIGNED NOT NULL DEFAULT 0, | ||
INDEX (funcid, error_time), | ||
INDEX (error_time), | ||
INDEX (jobid) | ||
); | ||
error_time int(10) unsigned NOT NULL, | ||
jobid bigint(20) unsigned NOT NULL, | ||
message mediumtext, | ||
funcid int(10) unsigned NOT NULL DEFAULT '0', | ||
KEY funcid (funcid,error_time), | ||
KEY jobid (jobid), | ||
KEY idx_error_time_funcid (error_time,funcid) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE exitstatus ( | ||
jobid BIGINT UNSIGNED PRIMARY KEY NOT NULL, | ||
funcid INT UNSIGNED NOT NULL DEFAULT 0, | ||
status SMALLINT UNSIGNED, | ||
completion_time INTEGER UNSIGNED, | ||
delete_after INTEGER UNSIGNED, | ||
note MEDIUMTEXT, | ||
elapsed DOUBLE, | ||
INDEX (funcid), | ||
INDEX (delete_after) | ||
); | ||
jobid bigint(20) unsigned NOT NULL, | ||
funcid int(10) unsigned NOT NULL DEFAULT '0', | ||
status smallint(5) unsigned DEFAULT NULL, | ||
completion_time int(10) unsigned DEFAULT NULL, | ||
delete_after int(10) unsigned DEFAULT NULL, | ||
note mediumtext, | ||
elapsed double DEFAULT NULL, | ||
PRIMARY KEY (jobid), | ||
KEY funcid (funcid), | ||
KEY delete_after (delete_after), | ||
KEY idx_funcid_status_completion_time (funcid,status,completion_time), | ||
KEY idx_elapsed (elapsed), | ||
KEY idx_completion_time_funcid_status (completion_time,funcid,status) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |