From 488918d2723e5add8f3f421ee5bba85e762f7481 Mon Sep 17 00:00:00 2001 From: witersen <1801168257@qq.com> Date: Mon, 9 May 2022 17:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E4=BA=8C=E8=BF=9B=E5=88=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84=E9=9B=86=E6=88=90=E5=88=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E5=B9=B6=E7=BB=9F=E4=B8=80=E4=BB=8E?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=AF=E9=80=9A=E8=BF=87=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E7=A8=8B=E5=BA=8F=E8=BF=9B=E8=A1=8C=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02.php/app/service/Svn.php | 4 +- 02.php/app/service/Svnrep.php | 11 +- 02.php/app/service/base/Base.php | 12 +- 02.php/app/util/SVNAdmin/Core.php | 17 ++- 02.php/app/util/SVNAdmin/Group.php | 6 +- 02.php/app/util/SVNAdmin/Rep.php | 44 ++++--- 02.php/app/util/SVNAdmin/User.php | 6 +- ...svnadmin.mysql.struct.sql => svnadmin.sql} | 6 +- ...{svnadmin.sqlite.struct.db => svnadmin.db} | Bin 36864 -> 45056 bytes ...vnadmin.sqlite.struct.sql => svnadmin.sql} | 107 +++++++++++++++--- 10 files changed, 156 insertions(+), 57 deletions(-) rename 03.database/mysql/{svnadmin.mysql.struct.sql => svnadmin.sql} (98%) rename 03.database/sqlite/{svnadmin.sqlite.struct.db => svnadmin.db} (79%) rename 03.database/sqlite/{svnadmin.sqlite.struct.sql => svnadmin.sql} (59%) diff --git a/02.php/app/service/Svn.php b/02.php/app/service/Svn.php index 072c5f2..a7b509b 100644 --- a/02.php/app/service/Svn.php +++ b/02.php/app/service/Svn.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-24 23:37:05 * @LastEditors: witersen - * @LastEditTime: 2022-05-08 20:30:34 + * @LastEditTime: 2022-05-09 17:04:19 * @Description: QQ:1801168257 */ @@ -103,7 +103,7 @@ class Svn extends Base //获取Subversion版本 $version = '-'; if ($installed != 0) { - $versionInfo = FunShellExec('svnserve --version'); + $versionInfo = FunShellExec(sprintf("'%s' --version", $this->config_bin['svnserve'])); $versionInfo = $versionInfo['result']; preg_match_all($this->config_reg['REG_SUBVERSION_VERSION'], $versionInfo, $versionInfoPreg); if (array_key_exists(0, $versionInfoPreg[0])) { diff --git a/02.php/app/service/Svnrep.php b/02.php/app/service/Svnrep.php index c803198..17b0692 100644 --- a/02.php/app/service/Svnrep.php +++ b/02.php/app/service/Svnrep.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-24 23:37:05 * @LastEditors: witersen - * @LastEditTime: 2022-05-08 20:59:18 + * @LastEditTime: 2022-05-09 17:08:00 * @Description: QQ:1801168257 */ @@ -57,7 +57,8 @@ class Svnrep extends Base //创建空仓库 //解决创建中文仓库乱码问题 - FunShellExec('export LC_CTYPE=en_US.UTF-8 && svnadmin create ' . $this->config_svn['rep_base_path'] . $this->payload['rep_name']); + $cmd = sprintf("export LC_CTYPE=en_US.UTF-8 && '%s' create " . $this->config_svn['rep_base_path'] . $this->payload['rep_name'], $this->config_bin['svnadmin']); + FunShellExec($cmd); if ($this->payload['rep_type'] == '2') { //以指定的目录结构初始化仓库 @@ -209,7 +210,7 @@ class Svnrep extends Base $authzContent = $this->authzContent; foreach ($userRepList as $key => $value) { - $cmd = sprintf("svnlook tree '%s' --full-paths --non-recursive '%s'", $this->config_svn['rep_base_path'] . $value['repName'], $value['priPath']); + $cmd = sprintf("'%s' tree '%s' --full-paths --non-recursive '%s'", $this->config_bin['svnlook'], $this->config_svn['rep_base_path'] . $value['repName'], $value['priPath']); $result = FunShellExec($cmd); if (strstr($result['error'], 'svnlook: E160013:')) { @@ -658,7 +659,7 @@ class Svnrep extends Base $path = $this->payload['path']; //获取全路径的一层目录树 - $cmdSvnlookTree = sprintf("svnlook tree '%s' --full-paths --non-recursive '%s'", $this->config_svn['rep_base_path'] . $this->payload['rep_name'], $path); + $cmdSvnlookTree = sprintf("'%s' tree '%s' --full-paths --non-recursive '%s'", $this->config_bin['svnlook'],$this->config_svn['rep_base_path'] . $this->payload['rep_name'], $path); $result = FunShellExec($cmdSvnlookTree); $result = $result['result']; $resultArray = explode("\n", trim($result)); @@ -755,7 +756,7 @@ class Svnrep extends Base $path = $this->payload['path']; //获取全路径的一层目录树 - $cmdSvnlookTree = sprintf("svnlook tree '%s' --full-paths --non-recursive '%s'", $this->config_svn['rep_base_path'] . $this->payload['rep_name'], $path); + $cmdSvnlookTree = sprintf("'%s' tree '%s' --full-paths --non-recursive '%s'", $this->config_bin['svnlook'],$this->config_svn['rep_base_path'] . $this->payload['rep_name'], $path); $result = FunShellExec($cmdSvnlookTree); $result = $result['result']; $resultArray = explode("\n", trim($result)); diff --git a/02.php/app/service/base/Base.php b/02.php/app/service/base/Base.php index b7e87ab..65f3654 100644 --- a/02.php/app/service/base/Base.php +++ b/02.php/app/service/base/Base.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-05-06 18:42:00 * @LastEditors: witersen - * @LastEditTime: 2022-05-07 12:11:18 + * @LastEditTime: 2022-05-09 16:38:22 * @Description: QQ:1801168257 */ @@ -36,6 +36,7 @@ class Base public $database; //配置信息 + public $config_bin; private $config_routers; private $config_database; public $config_version; @@ -65,7 +66,8 @@ class Base global $payload; //配置信息 - $this->config_routers = Config::get('router'); //路由 + $this->config_bin = Config::get('bin'); //可执行文件路径 + $this->config_routers = Config::get('router'); //路由 $this->config_database = Config::get('database'); //数据库配置 $this->config_version = Config::get('version'); //版本 $this->config_update = Config::get('update'); //升级检测 @@ -139,9 +141,9 @@ class Base /** * 10、svnadmin对象 */ - $this->SVNAdminGroup = new Group($this->authzContent, $this->passwdContent, $this->config_svn); - $this->SVNAdminRep = new Rep($this->authzContent, $this->passwdContent, $this->config_svn); - $this->SVNAdminUser = new User($this->authzContent, $this->passwdContent, $this->config_svn); + $this->SVNAdminGroup = new Group($this->authzContent, $this->passwdContent, $this->config_svn, $this->config_bin); + $this->SVNAdminRep = new Rep($this->authzContent, $this->passwdContent, $this->config_svn, $this->config_bin); + $this->SVNAdminUser = new User($this->authzContent, $this->passwdContent, $this->config_svn, $this->config_bin); /** * 11、检查对象 diff --git a/02.php/app/util/SVNAdmin/Core.php b/02.php/app/util/SVNAdmin/Core.php index 05ff225..402a880 100644 --- a/02.php/app/util/SVNAdmin/Core.php +++ b/02.php/app/util/SVNAdmin/Core.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-27 23:19:24 * @LastEditors: witersen - * @LastEditTime: 2022-05-04 17:14:16 + * @LastEditTime: 2022-05-09 16:36:56 * @Description: QQ:1801168257 * @copyright: https://github.com/witersen/ */ @@ -203,13 +203,26 @@ class Core */ protected $REG_REP_INFO = "/(.*):[\S]*(.*)/m"; + /** + * 配置文件svn内容 + * + * @var array + */ protected $config_svn; + /** + * 配置文件bin内容 + * + * @var array + */ + protected $config_bin; + - function __construct($authzFileContent, $passwdFileContent, $config_svn) + function __construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin) { $this->authzFileContent = $authzFileContent; $this->passwdFileContent = $passwdFileContent; $this->config_svn = $config_svn; + $this->config_bin = $config_bin; } } diff --git a/02.php/app/util/SVNAdmin/Group.php b/02.php/app/util/SVNAdmin/Group.php index c870c2a..75dd7b4 100644 --- a/02.php/app/util/SVNAdmin/Group.php +++ b/02.php/app/util/SVNAdmin/Group.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-27 15:55:52 * @LastEditors: witersen - * @LastEditTime: 2022-05-06 20:13:50 + * @LastEditTime: 2022-05-09 16:37:11 * @Description: QQ:1801168257 * @copyright: https://github.com/witersen/ */ @@ -12,9 +12,9 @@ namespace SVNAdmin\SVN; class Group extends Core { - function __construct($authzFileContent, $passwdFileContent, $config_svn) + function __construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin) { - parent::__construct($authzFileContent, $passwdFileContent, $config_svn); + parent::__construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin); } /** diff --git a/02.php/app/util/SVNAdmin/Rep.php b/02.php/app/util/SVNAdmin/Rep.php index f8f56e6..5604b14 100644 --- a/02.php/app/util/SVNAdmin/Rep.php +++ b/02.php/app/util/SVNAdmin/Rep.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-27 15:45:45 * @LastEditors: witersen - * @LastEditTime: 2022-05-04 19:18:45 + * @LastEditTime: 2022-05-09 16:58:20 * @Description: QQ:1801168257 * @copyright: https://github.com/witersen/ */ @@ -12,9 +12,9 @@ namespace SVNAdmin\SVN; class Rep extends Core { - function __construct($authzFileContent, $passwdFileContent, $config_svn) + function __construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin) { - parent::__construct($authzFileContent, $passwdFileContent, $config_svn); + parent::__construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin); } /** @@ -852,7 +852,7 @@ class Rep extends Core */ function InitRepStruct($templetePath, $repPath, $initUser = 'SVNAdmin', $initPass = 'SVNAdmin', $message = 'Initial structure') { - $cmd = sprintf("svn import '%s' 'file:///%s' --quiet --username '%s' --password '%s' --message '%s'", $templetePath, $repPath, $initUser, $initPass, $message); + $cmd = sprintf("'%s' import '%s' 'file:///%s' --quiet --username '%s' --password '%s' --message '%s'", $this->config_bin['svn'], $templetePath, $repPath, $initUser, $initPass, $message); FunShellExec($cmd); } @@ -874,7 +874,7 @@ class Rep extends Core { $repPath = $this->config_svn['rep_base_path'] . $repName; - $svnadminInfoCmd = sprintf("svnadmin info '%s'", $repPath); + $svnadminInfoCmd = sprintf("'%s' info '%s'", $this->config_bin['svnadmin'], $repPath); $cmdResult = FunShellExec($svnadminInfoCmd); $cmdResult = $cmdResult['result']; @@ -894,7 +894,7 @@ class Rep extends Core function GetRepTree($repName) { $repPath = $this->config_svn['rep_base_path'] . $repName; - $svnadminInfoCmd = sprintf("svnlook tree '%s'", $repPath); + $svnadminInfoCmd = sprintf("'%s' tree '%s'", $this->config_bin['svnlook'], $repPath); $cmdResult = FunShellExec($svnadminInfoCmd); $cmdResult = $cmdResult['result']; // $cmdResult = FunShellExec($svnadminInfoCmd); @@ -1198,20 +1198,22 @@ class Rep extends Core /** * 获取仓库的修订版本数量 + * svnadmin info */ function GetRepRev($repName) { - $cmd = sprintf("svnadmin info '%s' | grep 'Revisions' | awk '{print $2}'", $this->config_svn['rep_base_path'] . $repName); + $cmd = sprintf("'%s' info '%s' | grep 'Revisions' | awk '{print $2}'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $repName); $result = FunShellExec($cmd); return (int)$result['result']; } /** * 获取仓库的属性内容(key-value的形式) + * svnadmin info */ function GetRepDetail($repName) { - $cmd = sprintf("svnadmin info '%s'", $this->config_svn['rep_base_path'] . $repName); + $cmd = sprintf("'%s' info '%s'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $repName); $result = FunShellExec($cmd); return $result['result']; } @@ -1222,10 +1224,12 @@ class Rep extends Core * 目前为默认最新版本 * * 根据体积大小自动调整单位 + * + * svnlook file */ function GetRepRevFileSize($repName, $filePath) { - $cmd = sprintf("svnlook filesize '%s' '%s'", $this->config_svn['rep_base_path'] . $repName, $filePath); + $cmd = sprintf("'%s' filesize '%s' '%s'", $this->config_bin['svnlook'], $this->config_svn['rep_base_path'] . $repName, $filePath); $result = FunShellExec($cmd); $size = (int)$result['result']; return FunFormatSize($size); @@ -1233,10 +1237,12 @@ class Rep extends Core /** * 获取仓库下指定文件或者文件夹的最高修订版本 + * + * svnlook history */ function GetRepFileRev($repName, $filePath) { - $cmd = sprintf("svnlook history --limit 1 '%s' '%s'", $this->config_svn['rep_base_path'] . $repName, $filePath); + $cmd = sprintf("'%s' history --limit 1 '%s' '%s'", $this->config_bin['svnlook'], $this->config_svn['rep_base_path'] . $repName, $filePath); $result = FunShellExec($cmd); $result = $result['result']; $resultArray = explode("\n", $result); @@ -1247,30 +1253,36 @@ class Rep extends Core /** * 获取仓库下指定文件或者文件夹的作者 + * + * svnlook author */ function GetRepFileAuthor($repName, $rev) { - $cmd = sprintf("svnlook author -r %s '%s'", $rev, $this->config_svn['rep_base_path'] . $repName); + $cmd = sprintf("'%s' author -r %s '%s'", $this->config_bin['svnlook'], $rev, $this->config_svn['rep_base_path'] . $repName); $result = FunShellExec($cmd); return $result['result']; } /** * 获取仓库下指定文件或者文件夹的提交日期 + * + * svnlook date */ function GetRepFileDate($repName, $rev) { - $cmd = sprintf("svnlook date -r %s '%s'", $rev, $this->config_svn['rep_base_path'] . $repName); + $cmd = sprintf("'%s' date -r %s '%s'", $this->config_bin['svnlook'], $rev, $this->config_svn['rep_base_path'] . $repName); $result = FunShellExec($cmd); return $result['result']; } /** * 获取仓库下指定文件或者文件夹的提交日志 + * + * svnlook log */ function GetRepFileLog($repName, $rev) { - $cmd = sprintf("svnlook log -r %s '%s'", $rev, $this->config_svn['rep_base_path'] . $repName); + $cmd = sprintf("'%s' log -r %s '%s'", $this->config_bin['svnlook'], $rev, $this->config_svn['rep_base_path'] . $repName); $result = FunShellExec($cmd); return $result['result']; } @@ -1282,7 +1294,7 @@ class Rep extends Core */ function RepDump($repName, $backupName) { - $cmd = sprintf('svnadmin dump %s --quiet > %s', $this->config_svn['rep_base_path'] . $repName, $this->config_svn['backup_base_path'] . $backupName); + $cmd = sprintf("'%s' dump '%s' --quiet > '%s'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $repName, $this->config_svn['backup_base_path'] . $backupName); FunShellExec($cmd); } @@ -1300,7 +1312,7 @@ class Rep extends Core */ function RepLoad($repName, $fileName) { - $cmd = sprintf("svnadmin load --quiet '%s' < '%s'", $this->config_svn['rep_base_path'] . $repName, $this->config_svn['backup_base_path'] . $fileName); + $cmd = sprintf("'%s' load --quiet '%s' < '%s'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $repName, $this->config_svn['backup_base_path'] . $fileName); $result = FunShellExec($cmd); return $result; } @@ -1310,7 +1322,7 @@ class Rep extends Core */ function CheckSvnUserPathAutzh($checkoutHost, $repName, $repPath, $svnUserName, $svnUserPass) { - $cmd = sprintf("svn list '%s' --username '%s' --password '%s' --no-auth-cache --non-interactive --trust-server-cert", $checkoutHost . '/' . $repName . $repPath, $svnUserName, $svnUserPass); + $cmd = sprintf("'%s' list '%s' --username '%s' --password '%s' --no-auth-cache --non-interactive --trust-server-cert", $this->config_bin['svn'], $checkoutHost . '/' . $repName . $repPath, $svnUserName, $svnUserPass); $result = FunShellExec($cmd); if ($result['resultCode'] != 0) { diff --git a/02.php/app/util/SVNAdmin/User.php b/02.php/app/util/SVNAdmin/User.php index 75b9ac8..208ad26 100644 --- a/02.php/app/util/SVNAdmin/User.php +++ b/02.php/app/util/SVNAdmin/User.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-27 15:57:48 * @LastEditors: witersen - * @LastEditTime: 2022-05-04 17:15:02 + * @LastEditTime: 2022-05-09 16:37:46 * @Description: QQ:1801168257 * @copyright: https://github.com/witersen/ */ @@ -12,9 +12,9 @@ namespace SVNAdmin\SVN; class User extends Core { - function __construct($authzFileContent, $passwdFileContent, $config_svn) + function __construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin) { - parent::__construct($authzFileContent, $passwdFileContent, $config_svn); + parent::__construct($authzFileContent, $passwdFileContent, $config_svn, $config_bin); } /** diff --git a/03.database/mysql/svnadmin.mysql.struct.sql b/03.database/mysql/svnadmin.sql similarity index 98% rename from 03.database/mysql/svnadmin.mysql.struct.sql rename to 03.database/mysql/svnadmin.sql index de248a8..680ff08 100644 --- a/03.database/mysql/svnadmin.mysql.struct.sql +++ b/03.database/mysql/svnadmin.sql @@ -28,9 +28,8 @@ CREATE TABLE `admin_users` ( `admin_user_password` varchar(45) NOT NULL COMMENT '用户密码', `admin_user_phone` char(11) DEFAULT NULL COMMENT '用户手机号', `admin_user_email` varchar(45) DEFAULT NULL COMMENT '用户邮箱', - `admin_user_salt` varchar(45) NOT NULL COMMENT '盐值', PRIMARY KEY (`admin_user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理系统用户'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理系统用户'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39,6 +38,7 @@ CREATE TABLE `admin_users` ( LOCK TABLES `admin_users` WRITE; /*!40000 ALTER TABLE `admin_users` DISABLE KEYS */; +INSERT INTO `admin_users` VALUES (1,'admin','admin',NULL,NULL); /*!40000 ALTER TABLE `admin_users` ENABLE KEYS */; UNLOCK TABLES; @@ -270,4 +270,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-05-04 20:27:12 +-- Dump completed on 2022-05-09 14:22:54 diff --git a/03.database/sqlite/svnadmin.sqlite.struct.db b/03.database/sqlite/svnadmin.db similarity index 79% rename from 03.database/sqlite/svnadmin.sqlite.struct.db rename to 03.database/sqlite/svnadmin.db index 0f23e45f46c96ec7488e79694b61dbd7b80e4ee3..0e79b266f21896014d12c20d0acd4d925dc2a7bf 100644 GIT binary patch delta 630 zcmZozz|`=7X@az%J_7>-HxR>s;6xo`MSTW6>yNyAXBoKI4~u4LqXtI$+77)PnfD#N1RRg%H<>5CuPfAP)8Mfk?tE!zu~V z2~+@)gQ$nQ38#srd6|W!V9V;!Z3_tU^mPo1RPc6tm$mAE4Waj4;Ln$WbAXmo_SA`HqCm&Y@C8#JYBp_UnK?3i$I?8Z032?KED=RZLr%(RJCe6q- zS&ID?GteWO1Xu((82LXi@PFXHxmi%)0{`SY`XT~+jLgcMi7C06kVq?DWRNgPfQ5~b d{~ZJWJD{>B{6YeZYz*S!3=CjZU}BMg001RFxcmSB delta 186 zcmZp8z|^pSX@az%76StVClJE`&qN(#SuF-V>yNyAXBjxyzA*4r^Oo^cbH{V#amKKH z;n3bJC{V$s)?~uTF0QQ1*rH#On3R*6n39{B7hhVOT2ze0WST6@|4K!NmrFrG2_YO` zoS0Lhq!8j75u)Jd55%E9KASZ-ma{Q28gFdWXWZn#A;7|alm8~rrVIR&@92w6oFK5t MfhAxwi@+a#08fH6*Z=?k diff --git a/03.database/sqlite/svnadmin.sqlite.struct.sql b/03.database/sqlite/svnadmin.sql similarity index 59% rename from 03.database/sqlite/svnadmin.sqlite.struct.sql rename to 03.database/sqlite/svnadmin.sql index 3ca760a..95ebfba 100644 --- a/03.database/sqlite/svnadmin.sqlite.struct.sql +++ b/03.database/sqlite/svnadmin.sql @@ -1,7 +1,7 @@ /* Navicat Premium Data Transfer - Source Server : svnadminv2.3 + Source Server : svnadmin.sqlite.struct Source Server Type : SQLite Source Server Version : 3030001 Source Schema : main @@ -10,7 +10,7 @@ Target Server Version : 3030001 File Encoding : 65001 - Date: 23/04/2022 15:03:11 + Date: 09/05/2022 14:15:16 */ PRAGMA foreign_keys = false; @@ -24,10 +24,14 @@ CREATE TABLE "admin_users" ( "admin_user_name" TEXT(45) NOT NULL, "admin_user_password" TEXT(45) NOT NULL, "admin_user_phone" TEXT(11), - "admin_user_email" TEXT, - "admin_user_salt" TEXT NOT NULL + "admin_user_email" TEXT ); +-- ---------------------------- +-- Records of admin_users +-- ---------------------------- +INSERT INTO "admin_users" VALUES (1, 'admin', 'admin', NULL, NULL); + -- ---------------------------- -- Table structure for black_token -- ---------------------------- @@ -40,6 +44,10 @@ CREATE TABLE "black_token" ( "insert_time" TEXT(45) NOT NULL ); +-- ---------------------------- +-- Records of black_token +-- ---------------------------- + -- ---------------------------- -- Table structure for logs -- ---------------------------- @@ -53,14 +61,24 @@ CREATE TABLE "logs" ( ); -- ---------------------------- --- Table structure for sqlite_sequence +-- Records of logs -- ---------------------------- -DROP TABLE IF EXISTS "sqlite_sequence"; -CREATE TABLE "sqlite_sequence" ( - "name", - "seq" + +-- ---------------------------- +-- Table structure for options +-- ---------------------------- +DROP TABLE IF EXISTS "options"; +CREATE TABLE "options" ( + "option_id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "option_name" text NOT NULL, + "option_value" text NOT NULL, + "option_description" TEXT ); +-- ---------------------------- +-- Records of options +-- ---------------------------- + -- ---------------------------- -- Table structure for svn_groups -- ---------------------------- @@ -73,6 +91,45 @@ CREATE TABLE "svn_groups" ( "svn_group_note" TEXT(1000) ); +-- ---------------------------- +-- Records of svn_groups +-- ---------------------------- + +-- ---------------------------- +-- Table structure for svn_reps +-- ---------------------------- +DROP TABLE IF EXISTS "svn_reps"; +CREATE TABLE "svn_reps" ( + "rep_id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "rep_name" TEXT(1000) NOT NULL, + "rep_size" integer, + "rep_rev" integer, + "rep_uuid" text, + "rep_note" TEXT(1000) +); + +-- ---------------------------- +-- Records of svn_reps +-- ---------------------------- + +-- ---------------------------- +-- Table structure for svn_user_pri_paths +-- ---------------------------- +DROP TABLE IF EXISTS "svn_user_pri_paths"; +CREATE TABLE "svn_user_pri_paths" ( + "svnn_user_pri_path_id" INTEGER NOT NULL, + "rep_name" TEXT NOT NULL, + "pri_path" TEXT NOT NULL, + "rep_pri" TEXT, + "svn_user_name" TEXT NOT NULL, + "unique" TEXT NOT NULL, + PRIMARY KEY ("svnn_user_pri_path_id") +); + +-- ---------------------------- +-- Records of svn_user_pri_paths +-- ---------------------------- + -- ---------------------------- -- Table structure for svn_users -- ---------------------------- @@ -85,6 +142,10 @@ CREATE TABLE "svn_users" ( "svn_user_note" TEXT(1000) ); +-- ---------------------------- +-- Records of svn_users +-- ---------------------------- + -- ---------------------------- -- Table structure for verification_code -- ---------------------------- @@ -99,16 +160,26 @@ CREATE TABLE "verification_code" ( ); -- ---------------------------- --- Table structure for svn_reps +-- Records of verification_code -- ---------------------------- -DROP TABLE IF EXISTS "svn_reps"; -CREATE TABLE "svn_reps" ( - "rep_id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - "rep_name" TEXT(1000) NOT NULL, - "rep_size" integer, - "rep_rev" integer, - "rep_uuid" text, - "rep_note" TEXT(1000) + +-- ---------------------------- +-- Table structure for sqlite_sequence +-- ---------------------------- +DROP TABLE IF EXISTS "sqlite_sequence"; +CREATE TABLE "sqlite_sequence" ( + "name", + "seq" ); +-- ---------------------------- +-- Records of sqlite_sequence +-- ---------------------------- +INSERT INTO "sqlite_sequence" VALUES ('admin_users', 1); + +-- ---------------------------- +-- Auto increment value for admin_users +-- ---------------------------- +UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'admin_users'; + PRAGMA foreign_keys = true;