-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSphereGuard.sql
More file actions
167 lines (133 loc) · 4.08 KB
/
Copy pathSphereGuard.sql
File metadata and controls
167 lines (133 loc) · 4.08 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
-- phpMyAdmin SQL Dump
-- version 4.2.6
-- http://www.phpmyadmin.net
--
-- Généré le : Mer 20 Août 2014 à 11:46
-- Version du serveur : 5.5.38-0ubuntu0.12.04.1
-- Version de PHP : 5.3.10-1ubuntu3.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de données : `SphereGuard`
--
CREATE DATABASE `SphereGuard` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `SphereGuard`;
-- --------------------------------------------------------
--
-- Structure de la table `api`
--
CREATE TABLE IF NOT EXISTS `api` (
`pk_api` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`mail` varchar(255) NOT NULL,
`apikey` text NOT NULL,
`nbCall` float NOT NULL,
`admin` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=42 ;
-- --------------------------------------------------------
--
-- Contenu de la table `api`
--
INSERT INTO `api` (`name`, `password`, `mail`, `apikey`, `admin`) VALUES
('Admin', '8be3c943b1609fffbfc51aad666d0a04adf83c9d', 'admin@you.tld', 'df10891bfbdbb3b456bbba10d8f1ba6ca87e527c', 1);
-- --------------------------------------------------------
--
-- Structure de la table `host`
--
CREATE TABLE IF NOT EXISTS `host` (
`pk_host` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`ip` varchar(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
-- --------------------------------------------------------
--
-- Structure de la table `performance`
--
CREATE TABLE IF NOT EXISTS `performance` (
`pk_performance` int(11) NOT NULL,
`fk_type` int(11) NOT NULL,
`value` varchar(255) NOT NULL,
`fk_host` int(11) NOT NULL,
`date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=116374 ;
-- --------------------------------------------------------
--
-- Structure de la table `performance_type`
--
CREATE TABLE IF NOT EXISTS `performance_type` (
`pk_type` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`unit` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
--
-- Contenu de la table `performance_type`
--
INSERT INTO `performance_type` (`pk_type`, `name`, `unit`) VALUES
(1, 'Used RAM', '%'),
(2, 'Cpu usage', '%'),
(3, 'Disk usage', '%'),
(4, 'cpuTemp', '°C'),
(5, 'hddTemp', '°C');
--
-- Index pour les tables exportées
--
--
-- Index pour la table `api`
--
ALTER TABLE `api`
ADD PRIMARY KEY (`pk_api`);
--
-- Index pour la table `host`
--
ALTER TABLE `host`
ADD PRIMARY KEY (`pk_host`);
--
-- Index pour la table `performance`
--
ALTER TABLE `performance`
ADD PRIMARY KEY (`pk_performance`), ADD KEY `fk_type` (`fk_type`,`fk_host`), ADD KEY `fk_host` (`fk_host`);
--
-- Index pour la table `performance_type`
--
ALTER TABLE `performance_type`
ADD PRIMARY KEY (`pk_type`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `api`
--
ALTER TABLE `api`
MODIFY `pk_api` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=42;
--
-- AUTO_INCREMENT pour la table `host`
--
ALTER TABLE `host`
MODIFY `pk_host` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT pour la table `performance`
--
ALTER TABLE `performance`
MODIFY `pk_performance` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=116374;
--
-- AUTO_INCREMENT pour la table `performance_type`
--
ALTER TABLE `performance_type`
MODIFY `pk_type` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `performance`
--
ALTER TABLE `performance`
ADD CONSTRAINT `performance_ibfk_1` FOREIGN KEY (`fk_type`) REFERENCES `performance_type` (`pk_type`),
ADD CONSTRAINT `performance_ibfk_2` FOREIGN KEY (`fk_host`) REFERENCES `host` (`pk_host`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;