-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdb_structure.sql
97 lines (82 loc) · 3.07 KB
/
db_structure.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--
-- Table structure for table `api_keys`
--
CREATE TABLE IF NOT EXISTS `api_keys` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`api_key` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`deployment_id` int(10) unsigned NOT NULL,
`password` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`encryption_key` blob NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `api_key_2` (`api_key`),
KEY `api_key` (`api_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table `deployments`
--
CREATE TABLE IF NOT EXISTS `deployments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`server_id` int(10) unsigned NOT NULL DEFAULT '0',
`repository_id` int(10) unsigned NOT NULL DEFAULT '0',
`branch` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`target_path` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`tasks` blob NOT NULL,
PRIMARY KEY (`id`),
KEY `server_id` (`server_id`,`repository_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `deployment_logs`
--
CREATE TABLE IF NOT EXISTS `deployment_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`deployment_id` int(11) NOT NULL DEFAULT '0',
`deployment_type` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`result` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`request_time` datetime DEFAULT NULL,
`end_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `deployment_id` (`deployment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `repositories`
--
CREATE TABLE IF NOT EXISTS `repositories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`url` blob NOT NULL,
`username` blob NOT NULL,
`password` blob NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `servers`
--
CREATE TABLE IF NOT EXISTS `servers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`hostname` blob NOT NULL,
`port` blob NOT NULL,
`username` blob NOT NULL,
`password` blob NOT NULL,
`root_path` blob NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(8) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`password` blob NOT NULL,
`user_key` blob NOT NULL,
`encryption_key` blob NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;