-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.sql
125 lines (99 loc) · 3.72 KB
/
db.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
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 23, 2014 at 07:10 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
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 */;
--
-- Database: `simpleleague`
--
-- --------------------------------------------------------
--
-- Table structure for table `games`
--
CREATE TABLE IF NOT EXISTS `games` (
`game_id` int(11) NOT NULL AUTO_INCREMENT,
`round_id` int(11) NOT NULL,
`player1_id` int(11) NOT NULL,
`player2_id` int(11) NOT NULL,
`player1_points` int(11) NOT NULL DEFAULT '0',
`player2_points` int(11) NOT NULL DEFAULT '0',
`player1_victorypoints` int(11) NOT NULL DEFAULT '0',
`player2_victorypoints` int(11) NOT NULL DEFAULT '0',
`player1_result_id` int(11) NOT NULL DEFAULT '0',
`player2_result_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`game_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`player_id` int(11) NOT NULL AUTO_INCREMENT,
`player_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `results`
--
CREATE TABLE IF NOT EXISTS `results` (
`result_id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`description_short` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
`sort` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`result_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `rounds`
--
CREATE TABLE IF NOT EXISTS `rounds` (
`round_id` int(11) NOT NULL AUTO_INCREMENT,
`season_id` int(11) NOT NULL,
`round_number` int(11) NOT NULL,
`description` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`finished` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`round_id`),
UNIQUE KEY `season_id` (`season_id`,`round_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `seasons`
--
CREATE TABLE IF NOT EXISTS `seasons` (
`season_id` int(11) NOT NULL AUTO_INCREMENT,
`season_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`no_statistics` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`season_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `seasons_players`
--
CREATE TABLE IF NOT EXISTS `seasons_players` (
`season_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`team_id` int(11) NOT NULL,
PRIMARY KEY (`season_id`,`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `teams`
--
CREATE TABLE IF NOT EXISTS `teams` (
`team_id` int(11) NOT NULL AUTO_INCREMENT,
`team_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`team_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!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 */;