1 DROP TABLE IF EXISTS plugin_hudson_job;
2 CREATE TABLE plugin_hudson_job (
3 job_id int(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT ,
4 group_id int(11) NOT NULL ,
5 job_url varchar(255) NOT NULL ,
6 name varchar(128) NOT NULL ,
7 use_svn_trigger tinyint(4) NOT NULL default 0 ,
8 use_cvs_trigger tinyint(4) NOT NULL default 0 ,
9 token varchar(128) NOT NULL
12 DROP TABLE IF EXISTS plugin_hudson_widget;
13 CREATE TABLE plugin_hudson_widget (
14 id int(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT ,
15 widget_name varchar(64) NOT NULL ,
16 owner_id int(11) UNSIGNED NOT NULL ,
17 owner_type varchar(1) NOT NULL ,
18 job_id int(11) NOT NULL
21 -- Enable service for project 1 and 100
22 INSERT INTO service(group_id, label, description, short_name, link, is_active, is_used, scope, rank) VALUES ( 100 , 'plugin_hudson:service_lbl_key' , 'plugin_hudson:service_desc_key' , 'hudson', '/plugins/hudson/?group_id=$group_id', 1 , 1 , 'system', 220 );
23 INSERT INTO service(group_id, label, description, short_name, link, is_active, is_used, scope, rank) VALUES ( 1 , 'plugin_hudson:service_lbl_key' , 'plugin_hudson:service_desc_key' , 'hudson', '/plugins/hudson/?group_id=1', 1 , 0 , 'system', 220 );
25 -- Create service for all other projects (but disabled)
26 INSERT INTO service(group_id, label, description, short_name, link, is_active, is_used, scope, rank)
27 SELECT DISTINCT group_id , 'plugin_hudson:service_lbl_key' , 'plugin_hudson:service_desc_key' , 'hudson', CONCAT('/plugins/hudson/?group_id=', group_id), 1 , 0 , 'system', 220
29 WHERE group_id NOT IN (SELECT group_id
34 -- Create references and add them into every project
35 INSERT INTO reference SET
37 description='plugin_hudson:reference_job_desc_key',
38 link='/plugins/hudson/?group_id=$group_id&action=view_job&job=$1',
40 service_short_name='hudson',
42 INSERT INTO reference_group (reference_id, group_id, is_active)
43 SELECT last_insert_id, group_id, 1
44 FROM (SELECT LAST_INSERT_ID() as last_insert_id) AS R, groups;
46 INSERT INTO reference SET
48 description='plugin_hudson:reference_build_desc_key',
49 link='/plugins/hudson/?group_id=$group_id&action=view_build&job=$1&build=$2',
51 service_short_name='hudson',
52 nature='hudson_build';
53 INSERT INTO reference_group (reference_id, group_id, is_active)
54 SELECT last_insert_id, group_id, 1
55 FROM (SELECT LAST_INSERT_ID() as last_insert_id) AS R, groups;
57 INSERT INTO reference SET
59 description='plugin_hudson:reference_build_desc_key',
60 link='/plugins/hudson/?group_id=$group_id&action=view_build&build=$1',
62 service_short_name='hudson',
63 nature='hudson_build';
64 INSERT INTO reference_group (reference_id, group_id, is_active)
65 SELECT last_insert_id, group_id, 1
66 FROM (SELECT LAST_INSERT_ID() as last_insert_id) AS R, groups;