-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.sql
executable file
·166 lines (134 loc) · 4.74 KB
/
install.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
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
-- Neural Mesh Install SQL Dump
-- v1.6.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!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 */;
--
-- Database: `nmesh`
--
-- --------------------------------------------------------
--
-- Table structure for table `cache`
--
CREATE TABLE IF NOT EXISTS `cache` (
`cacheID` varchar(32) NOT NULL,
`networkID` int(5) unsigned NOT NULL,
`cacheContent` longtext NOT NULL,
`cacheDate` datetime NOT NULL,
PRIMARY KEY (`cacheID`),
KEY `networkID` (`networkID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `epochs`
--
CREATE TABLE IF NOT EXISTS `epochs` (
`epochID` int(6) unsigned NOT NULL AUTO_INCREMENT,
`networkID` int(5) unsigned NOT NULL,
`iterations` int(6) unsigned NOT NULL,
`startMSE` decimal(10,9) unsigned NOT NULL,
`endMSE` decimal(10,9) unsigned NOT NULL,
`epochDate` datetime NOT NULL,
`execTime` decimal(15,8) unsigned NOT NULL DEFAULT '0.00000000',
`trainsetID` int(5) DEFAULT NULL,
PRIMARY KEY (`epochID`),
KEY `networkID` (`networkID`),
KEY `trainsetID` (`trainsetID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `networks`
--
CREATE TABLE IF NOT EXISTS `networks` (
`networkID` int(5) unsigned NOT NULL AUTO_INCREMENT,
`networkName` varchar(50) NOT NULL,
`snapshot` longtext,
`authkey` varchar(32) NOT NULL,
`networkType` enum('unmanaged','managed') NOT NULL DEFAULT 'unmanaged',
`momentumrate` decimal(5,4) NOT NULL DEFAULT '0.5000',
`learningrate` decimal(5,4) unsigned NOT NULL DEFAULT '1.0000',
`targetmse` decimal(5,4) unsigned DEFAULT '0.0020',
`epochmax` int(5) unsigned DEFAULT '10000',
`createdDate` datetime DEFAULT NULL,
PRIMARY KEY (`networkID`,`networkType`),
UNIQUE KEY `authkey` (`authkey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `patterns`
--
CREATE TABLE IF NOT EXISTS `patterns` (
`patternID` int(5) unsigned NOT NULL AUTO_INCREMENT,
`trainsetID` int(5) unsigned NOT NULL,
`pattern` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`output` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
PRIMARY KEY (`patternID`),
KEY `train` (`trainsetID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `trainsets`
--
CREATE TABLE IF NOT EXISTS `trainsets` (
`trainsetID` int(5) unsigned NOT NULL AUTO_INCREMENT,
`networkID` int(5) unsigned NOT NULL,
`label` varchar(20) NOT NULL,
PRIMARY KEY (`trainsetID`),
KEY `network` (`networkID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `usernetwork`
--
CREATE TABLE IF NOT EXISTS `usernetwork` (
`userID` int(5) NOT NULL,
`networkID` int(5) unsigned NOT NULL,
PRIMARY KEY (`userID`,`networkID`),
KEY `networkID` (`networkID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`userID` int(5) NOT NULL AUTO_INCREMENT,
`userName` varchar(50) NOT NULL,
`userPass` varchar(41) NOT NULL,
PRIMARY KEY (`userID`),
UNIQUE KEY `userName` (`userName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `cache`
--
ALTER TABLE `cache`
ADD CONSTRAINT `networkID_fk` FOREIGN KEY (`networkID`) REFERENCES `networks` (`networkID`) ON DELETE CASCADE;
--
-- Constraints for table `epochs`
--
ALTER TABLE `epochs`
ADD CONSTRAINT `epochs_ibfk_1` FOREIGN KEY (`networkID`) REFERENCES `networks` (`networkID`) ON DELETE CASCADE;
--
-- Constraints for table `patterns`
--
ALTER TABLE `patterns`
ADD CONSTRAINT `patterns_ibfk_1` FOREIGN KEY (`trainsetID`) REFERENCES `trainsets` (`trainsetID`) ON DELETE CASCADE;
--
-- Constraints for table `trainsets`
--
ALTER TABLE `trainsets`
ADD CONSTRAINT `trainsets_ibfk_1` FOREIGN KEY (`networkID`) REFERENCES `networks` (`networkID`) ON DELETE CASCADE;
--
-- Constraints for table `usernetwork`
--
ALTER TABLE `usernetwork`
ADD CONSTRAINT `usernetwork_ibfk_1` FOREIGN KEY (`userID`) REFERENCES `users` (`userID`) ON DELETE CASCADE,
ADD CONSTRAINT `usernetwork_ibfk_2` FOREIGN KEY (`networkID`) REFERENCES `networks` (`networkID`) ON DELETE CASCADE;
--
-- Add a default user
--
INSERT INTO `users`(`userName`,`userPass`) VALUES ("admin",PASSWORD("admin"));