* Revert code.

This commit is contained in:
caoyanyi
2023-10-24 10:56:17 +08:00
parent 710715e71b
commit c77b74c528
3 changed files with 4 additions and 9 deletions
-3
View File
@@ -1,3 +0,0 @@
ALTER TABLE `zt_job` ADD COLUMN `desc` text NULL AFTER `name`;
ALTER TABLE `zt_job` ADD COLUMN `jobKey` varchar(255) NOT NULL DEFAULT '' AFTER `pipeline`;
ALTER TABLE `zt_job` MODIFY COLUMN repo VARCHAR(255) NOT NULL DEFAULT '';
+1 -3
View File
@@ -951,13 +951,11 @@ CREATE INDEX `action` ON `zt_history`(`action`);
CREATE TABLE IF NOT EXISTS `zt_job` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`desc` text NULL,
`repo` varchar(255) NOT NULL DEFAULT '',
`repo` mediumint(8) unsigned NOT NULL DEFAULT '0',
`product` mediumint(8) unsigned NOT NULL DEFAULT '0',
`frame` varchar(20) NOT NULL DEFAULT '',
`engine` varchar(20) NOT NULL DEFAULT '',
`server` mediumint(8) unsigned NOT NULL DEFAULT '0',
`jobKey` varchar(500) NOT NULL DEFAULT '',
`pipeline` varchar(500) NOT NULL DEFAULT '',
`triggerType` varchar(255) NOT NULL DEFAULT '',
`sonarqubeServer` mediumint(8) unsigned NOT NULL DEFAULT '0',
+3 -3
View File
@@ -58,7 +58,7 @@ class jobModel extends model
->leftJoin(TABLE_REPO)->alias('t2')->on('t1.repo=t2.id')
->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t1.server=t3.id')
->where('t1.deleted')->eq('0')
->beginIF($repoID)->andWhere("FIND_IN_SET('{$repoID}', t1.repo)")->fi()
->beginIF($repoID)->andWhere('t1.repo')->eq($repoID)->fi()
->beginIF($engine)->andWhere('t1.engine')->eq($engine)->fi()
->beginIF($pipeline)->andWhere('t1.pipeline')->eq($pipeline)->fi()
->orderBy($orderBy)
@@ -77,7 +77,7 @@ class jobModel extends model
{
return $this->dao->select('id, name, lastStatus')->from(TABLE_JOB)
->where('deleted')->eq('0')
->andWhere("FIND_IN_SET('{$repoID}', repo)")
->andWhere('repo')->eq($repoID)
->orderBy('id_desc')
->fetchAll('id');
}
@@ -94,7 +94,7 @@ class jobModel extends model
{
return $this->dao->select('id, name')->from(TABLE_JOB)
->where('deleted')->eq('0')
->andWhere("FIND_IN_SET('{$repoID}', repo)")
->andWhere('repo')->eq($repoID)
->beginIF($engine)->andWhere('engine')->eq($engine)->fi()
->orderBy('id_desc')
->fetchPairs();