-
Notifications
You must be signed in to change notification settings - Fork 0
/
databaseshema.sql
40 lines (31 loc) · 1.34 KB
/
databaseshema.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
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 */;
CREATE DATABASE IF NOT EXISTS `charity-run` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;
USE `charity-run`;
CREATE TABLE IF NOT EXISTS `rounds` (
`name` varchar(64) CHARACTER SET latin1 NOT NULL,
`vorname` varchar(64) CHARACTER SET latin1 NOT NULL,
`klasse` varchar(64) CHARACTER SET latin1 NOT NULL,
`nummer` int(16) NOT NULL,
`runden` int(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
CREATE TABLE IF NOT EXISTS `timestamps` (
`id` int(16) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`nummer` int(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `rounds`
ADD PRIMARY KEY (`nummer`);
ALTER TABLE `timestamps`
ADD PRIMARY KEY (`id`);
ALTER TABLE `rounds`
MODIFY `nummer` int(16) NOT NULL AUTO_INCREMENT;
ALTER TABLE `timestamps`
MODIFY `id` int(16) NOT NULL AUTO_INCREMENT;
/*!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 */;