User:VasilievVV/cr-queues.sql

From mediawiki.org
-- Code queues. May be used both privately by developers as their own queues
-- and publically as public queues.
CREATE TABLE /*_*/code_queue (
	-- Repository ID
	cq_repo_id int not null,

	-- ID and name of the queue
	cq_id int not null primary key auto_increment,
	cq_name varbinary(255) not null,

	-- Ownership information. If owner is NULL, the queue is public
	cq_owner int default null,
	cq_owner_text varbinary(255) default null
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/cq_repo_name_owner ON /*_*/code_queue ( cq_repo_id, cq_name, cq_owner );

-- Code queue conditions.
CREATE TABLE /*_*/code_queue_filters (
	-- Related queue
	cqf_queue int not null,
	
	-- Type of the condition.
	-- Current possible values are "state", "path" and "timestamp"
	cqf_type varchar(25) not null,

	-- Value of the condition.
	-- Format is specific for each condition
	cqf_value mediumblob
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/cqf_queue_type ON /*_*/code_queue_filters( cqf_queue, cqf_type );