- Timestamp:
- May 27, 2020, 8:04:56 PM (5 years ago)
- Location:
- trunk/SQL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SQL/Structure.sql
r51 r57 1 -- -------------------------------------------------------- 2 -- Hostitel: localhost 3 -- Verze serveru: 10.3.20-MariaDB-0ubuntu0.19.10.1 - Ubuntu 19.10 4 -- OS serveru: debian-linux-gnu 5 -- HeidiSQL Verze: 10.3.0.5771 6 -- -------------------------------------------------------- 7 8 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 9 /*!40101 SET NAMES utf8 */; 10 /*!50503 SET NAMES utf8mb4 */; 11 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 12 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 13 14 -- Exportování struktury pro tabulka tanec.Dance 15 CREATE TABLE IF NOT EXISTS `Dance` ( 16 `Id` int(11) NOT NULL AUTO_INCREMENT, 17 `Name` varchar(255) NOT NULL, 18 `Group` int(11) DEFAULT NULL, 19 PRIMARY KEY (`Id`), 20 KEY `Group` (`Group`), 21 CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`) 22 ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; 23 24 -- Export dat nebyl vybrán. 25 26 -- Exportování struktury pro tabulka tanec.DanceFigure 27 CREATE TABLE IF NOT EXISTS `DanceFigure` ( 28 `Id` int(11) NOT NULL AUTO_INCREMENT, 1 -- phpMyAdmin SQL Dump 2 -- version 4.9.5deb2 3 -- https://www.phpmyadmin.net/ 4 -- 5 -- Počítač: localhost:3306 6 -- Vytvořeno: Stř 27. kvě 2020, 19:39 7 -- Verze serveru: 10.3.22-MariaDB-1ubuntu1 8 -- Verze PHP: 7.4.3 9 10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 SET AUTOCOMMIT = 0; 12 START TRANSACTION; 13 SET time_zone = "+00:00"; 14 15 -- 16 -- Databáze: `tanec` 17 -- 18 19 -- -------------------------------------------------------- 20 21 -- 22 -- Struktura tabulky `Dance` 23 -- 24 25 CREATE TABLE `Dance` ( 26 `Id` int(11) NOT NULL, 27 `Name` varchar(255) NOT NULL, 28 `Group` int(11) DEFAULT NULL 29 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 30 31 -- -------------------------------------------------------- 32 33 -- 34 -- Struktura tabulky `DanceFigure` 35 -- 36 37 CREATE TABLE `DanceFigure` ( 38 `Id` int(11) NOT NULL, 29 39 `NameCz` varchar(255) NOT NULL, 30 40 `NameEn` varchar(255) NOT NULL, 31 `Dance` int(11) NOT NULL, 32 PRIMARY KEY (`Id`), 33 UNIQUE KEY `Id` (`Id`), 34 KEY `Dance` (`Dance`), 35 CONSTRAINT `DanceFigure_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`) 36 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; 37 38 -- Export dat nebyl vybrán. 39 40 -- Exportování struktury pro tabulka tanec.DanceGroup 41 CREATE TABLE IF NOT EXISTS `DanceGroup` ( 42 `Id` int(11) NOT NULL AUTO_INCREMENT, 43 `Name` varchar(255) NOT NULL, 44 PRIMARY KEY (`Id`) 45 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 46 47 -- Export dat nebyl vybrán. 48 49 -- Exportování struktury pro tabulka tanec.Event 50 CREATE TABLE IF NOT EXISTS `Event` ( 51 `Id` int(11) NOT NULL AUTO_INCREMENT, 41 `Dance` int(11) NOT NULL 42 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 43 44 -- -------------------------------------------------------- 45 46 -- 47 -- Struktura tabulky `DanceGroup` 48 -- 49 50 CREATE TABLE `DanceGroup` ( 51 `Id` int(11) NOT NULL, 52 `Name` varchar(255) NOT NULL 53 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 54 55 -- -------------------------------------------------------- 56 57 -- 58 -- Struktura tabulky `Event` 59 -- 60 61 CREATE TABLE `Event` ( 62 `Id` int(11) NOT NULL, 52 63 `TimeFrom` datetime DEFAULT NULL, 53 64 `TimeTo` datetime DEFAULT NULL, … … 60 71 `Location` varchar(255) DEFAULT NULL, 61 72 `TimeImport` datetime DEFAULT NULL, 62 `RemoteId` varchar(255) DEFAULT NULL, 63 PRIMARY KEY (`Id`), 64 KEY `Source` (`Source`) 65 ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4; 66 67 -- Export dat nebyl vybrán. 68 69 -- Exportování struktury pro tabulka tanec.EventSource 70 CREATE TABLE IF NOT EXISTS `EventSource` ( 71 `Id` int(11) NOT NULL AUTO_INCREMENT, 73 `RemoteId` varchar(255) DEFAULT NULL 74 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 75 76 -- -------------------------------------------------------- 77 78 -- 79 -- Struktura tabulky `EventSource` 80 -- 81 82 CREATE TABLE `EventSource` ( 83 `Id` int(11) NOT NULL, 72 84 `Name` varchar(255) DEFAULT NULL, 73 85 `Method` varchar(255) DEFAULT NULL, 74 `URL` varchar(255) DEFAULT NULL, 75 PRIMARY KEY (`Id`) 76 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; 77 78 -- Export dat nebyl vybrán. 79 80 -- Exportování struktury pro tabulka tanec.MeetItem 81 CREATE TABLE IF NOT EXISTS `MeetItem` ( 82 `Id` int(11) NOT NULL AUTO_INCREMENT, 86 `URL` varchar(255) DEFAULT NULL 87 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 88 89 -- -------------------------------------------------------- 90 91 -- 92 -- Struktura tabulky `MeetItem` 93 -- 94 95 CREATE TABLE `MeetItem` ( 96 `Id` int(11) NOT NULL, 83 97 `Message` text NOT NULL, 84 98 `Name` varchar(255) NOT NULL, … … 95 109 `TimeImport` datetime DEFAULT NULL, 96 110 `RemoteId` varchar(255) DEFAULT NULL, 97 `Hidden` int(11) DEFAULT 0, 98 PRIMARY KEY (`Id`), 99 KEY `Source` (`Source`), 100 KEY `Time` (`Time`), 101 CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`) 102 ) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8; 103 104 -- Export dat nebyl vybrán. 105 106 -- Exportování struktury pro tabulka tanec.MeetSource 107 CREATE TABLE IF NOT EXISTS `MeetSource` ( 108 `Id` int(11) NOT NULL AUTO_INCREMENT, 111 `Hidden` int(11) DEFAULT 0 112 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 113 114 -- -------------------------------------------------------- 115 116 -- 117 -- Struktura tabulky `MeetSource` 118 -- 119 120 CREATE TABLE `MeetSource` ( 121 `Id` int(11) NOT NULL, 109 122 `Name` varchar(255) NOT NULL, 110 123 `URL` varchar(255) NOT NULL, 111 124 `Method` varchar(255) NOT NULL, 112 PRIMARY KEY (`Id`) 113 ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; 114 115 -- Export dat nebyl vybrán. 116 117 -- Exportování struktury pro tabulka tanec.Movie 118 CREATE TABLE IF NOT EXISTS `Movie` ( 119 `Id` int(11) NOT NULL AUTO_INCREMENT, 125 `Enabled` int(11) NOT NULL DEFAULT 1 126 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 127 128 -- -------------------------------------------------------- 129 130 -- 131 -- Struktura tabulky `Movie` 132 -- 133 134 CREATE TABLE `Movie` ( 135 `Id` int(11) NOT NULL, 120 136 `NameCz` varchar(255) NOT NULL, 121 137 `NameEn` varchar(255) NOT NULL, 122 138 `Year` int(11) NOT NULL, 123 139 `Imdb` varchar(255) NOT NULL, 124 `Csfd` varchar(255) NOT NULL, 125 PRIMARY KEY (`Id`), 126 KEY `Year` (`Year`) 127 ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 128 129 -- Export dat nebyl vybrán. 130 131 -- Exportování struktury pro tabulka tanec.Music 132 CREATE TABLE IF NOT EXISTS `Music` ( 133 `Id` int(11) NOT NULL AUTO_INCREMENT, 140 `Csfd` varchar(255) NOT NULL 141 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 142 143 -- -------------------------------------------------------- 144 145 -- 146 -- Struktura tabulky `Music` 147 -- 148 149 CREATE TABLE `Music` ( 150 `Id` int(11) NOT NULL, 134 151 `Name` varchar(255) NOT NULL, 135 152 `URL` varchar(255) NOT NULL, 136 `Dance` int(11) NOT NULL ,137 PRIMARY KEY (`Id`), 138 KEY `Dance` (`Dance`), 139 CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`) 140 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 141 142 -- Export dat nebyl vybrán.143 144 -- Exportování struktury pro tabulka tanec.Resource 145 CREATE TABLE IF NOT EXISTS`Resource` (146 `Id` int(11) NOT NULL AUTO_INCREMENT,153 `Dance` int(11) NOT NULL 154 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 155 156 -- -------------------------------------------------------- 157 158 -- 159 -- Struktura tabulky `Resource` 160 -- 161 162 CREATE TABLE `Resource` ( 163 `Id` int(11) NOT NULL, 147 164 `Name` varchar(255) NOT NULL, 148 165 `Dance` int(11) NOT NULL, 149 166 `URL` varchar(255) NOT NULL, 150 `Group` int(11) DEFAULT NULL ,151 PRIMARY KEY (`Id`), 152 KEY `Dance` (`Dance`), 153 KEY `Group` (`Group`), 154 CONSTRAINT `Resource_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`), 155 CONSTRAINT `Resource_ibfk_2` FOREIGN KEY (`Group`) REFERENCES `ResourceGroup` (`Id`) 156 ) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8; 157 158 -- Export dat nebyl vybrán. 159 160 -- Exportování struktury pro tabulka tanec.ResourceGroup 161 CREATE TABLE IF NOT EXISTS `ResourceGroup` ( 162 ` Id` int(11) NOT NULL AUTO_INCREMENT,163 `Name` varchar(255) NOT NULL, 164 `URL` varchar(255) NOT NULL, 165 PRIMARY KEY (`Id`) 166 ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 167 168 -- Export dat nebyl vybrán.169 170 -- Exportování struktury pro tabulka tanec.School 171 CREATE TABLE IF NOT EXISTS`School` (172 `Id` int(11) NOT NULL AUTO_INCREMENT,167 `Group` int(11) DEFAULT NULL 168 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 169 170 -- -------------------------------------------------------- 171 172 -- 173 -- Struktura tabulky `ResourceGroup` 174 -- 175 176 CREATE TABLE `ResourceGroup` ( 177 `Id` int(11) NOT NULL, 178 `Name` varchar(255) NOT NULL, 179 `URL` varchar(255) NOT NULL 180 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 181 182 -- -------------------------------------------------------- 183 184 -- 185 -- Struktura tabulky `School` 186 -- 187 188 CREATE TABLE `School` ( 189 `Id` int(11) NOT NULL, 173 190 `Name` varchar(255) NOT NULL, 174 191 `Address` varchar(255) NOT NULL, 175 `URL` varchar(255) NOT NULL, 176 PRIMARY KEY (`Id`) 177 ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; 178 179 -- Export dat nebyl vybrán. 180 181 /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; 182 /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; 183 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 192 `URL` varchar(255) NOT NULL 193 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 194 195 -- 196 -- Klíče pro exportované tabulky 197 -- 198 199 -- 200 -- Klíče pro tabulku `Dance` 201 -- 202 ALTER TABLE `Dance` 203 ADD PRIMARY KEY (`Id`), 204 ADD KEY `Group` (`Group`); 205 206 -- 207 -- Klíče pro tabulku `DanceFigure` 208 -- 209 ALTER TABLE `DanceFigure` 210 ADD PRIMARY KEY (`Id`), 211 ADD UNIQUE KEY `Id` (`Id`), 212 ADD KEY `Dance` (`Dance`); 213 214 -- 215 -- Klíče pro tabulku `DanceGroup` 216 -- 217 ALTER TABLE `DanceGroup` 218 ADD PRIMARY KEY (`Id`); 219 220 -- 221 -- Klíče pro tabulku `Event` 222 -- 223 ALTER TABLE `Event` 224 ADD PRIMARY KEY (`Id`), 225 ADD KEY `Source` (`Source`); 226 227 -- 228 -- Klíče pro tabulku `EventSource` 229 -- 230 ALTER TABLE `EventSource` 231 ADD PRIMARY KEY (`Id`); 232 233 -- 234 -- Klíče pro tabulku `MeetItem` 235 -- 236 ALTER TABLE `MeetItem` 237 ADD PRIMARY KEY (`Id`), 238 ADD KEY `Source` (`Source`), 239 ADD KEY `Time` (`Time`); 240 241 -- 242 -- Klíče pro tabulku `MeetSource` 243 -- 244 ALTER TABLE `MeetSource` 245 ADD PRIMARY KEY (`Id`); 246 247 -- 248 -- Klíče pro tabulku `Movie` 249 -- 250 ALTER TABLE `Movie` 251 ADD PRIMARY KEY (`Id`), 252 ADD KEY `Year` (`Year`); 253 254 -- 255 -- Klíče pro tabulku `Music` 256 -- 257 ALTER TABLE `Music` 258 ADD PRIMARY KEY (`Id`), 259 ADD KEY `Dance` (`Dance`); 260 261 -- 262 -- Klíče pro tabulku `Resource` 263 -- 264 ALTER TABLE `Resource` 265 ADD PRIMARY KEY (`Id`), 266 ADD KEY `Dance` (`Dance`), 267 ADD KEY `Group` (`Group`); 268 269 -- 270 -- Klíče pro tabulku `ResourceGroup` 271 -- 272 ALTER TABLE `ResourceGroup` 273 ADD PRIMARY KEY (`Id`); 274 275 -- 276 -- Klíče pro tabulku `School` 277 -- 278 ALTER TABLE `School` 279 ADD PRIMARY KEY (`Id`); 280 281 -- 282 -- AUTO_INCREMENT pro tabulky 283 -- 284 285 -- 286 -- AUTO_INCREMENT pro tabulku `Dance` 287 -- 288 ALTER TABLE `Dance` 289 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 290 291 -- 292 -- AUTO_INCREMENT pro tabulku `DanceFigure` 293 -- 294 ALTER TABLE `DanceFigure` 295 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 296 297 -- 298 -- AUTO_INCREMENT pro tabulku `DanceGroup` 299 -- 300 ALTER TABLE `DanceGroup` 301 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 302 303 -- 304 -- AUTO_INCREMENT pro tabulku `Event` 305 -- 306 ALTER TABLE `Event` 307 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 308 309 -- 310 -- AUTO_INCREMENT pro tabulku `EventSource` 311 -- 312 ALTER TABLE `EventSource` 313 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 314 315 -- 316 -- AUTO_INCREMENT pro tabulku `MeetItem` 317 -- 318 ALTER TABLE `MeetItem` 319 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 320 321 -- 322 -- AUTO_INCREMENT pro tabulku `MeetSource` 323 -- 324 ALTER TABLE `MeetSource` 325 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 326 327 -- 328 -- AUTO_INCREMENT pro tabulku `Movie` 329 -- 330 ALTER TABLE `Movie` 331 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 332 333 -- 334 -- AUTO_INCREMENT pro tabulku `Music` 335 -- 336 ALTER TABLE `Music` 337 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 338 339 -- 340 -- AUTO_INCREMENT pro tabulku `Resource` 341 -- 342 ALTER TABLE `Resource` 343 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 344 345 -- 346 -- AUTO_INCREMENT pro tabulku `ResourceGroup` 347 -- 348 ALTER TABLE `ResourceGroup` 349 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 350 351 -- 352 -- AUTO_INCREMENT pro tabulku `School` 353 -- 354 ALTER TABLE `School` 355 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; 356 357 -- 358 -- Omezení pro exportované tabulky 359 -- 360 361 -- 362 -- Omezení pro tabulku `Dance` 363 -- 364 ALTER TABLE `Dance` 365 ADD CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`); 366 367 -- 368 -- Omezení pro tabulku `DanceFigure` 369 -- 370 ALTER TABLE `DanceFigure` 371 ADD CONSTRAINT `DanceFigure_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`); 372 373 -- 374 -- Omezení pro tabulku `MeetItem` 375 -- 376 ALTER TABLE `MeetItem` 377 ADD CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`); 378 379 -- 380 -- Omezení pro tabulku `Music` 381 -- 382 ALTER TABLE `Music` 383 ADD CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`); 384 385 -- 386 -- Omezení pro tabulku `Resource` 387 -- 388 ALTER TABLE `Resource` 389 ADD CONSTRAINT `Resource_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`), 390 ADD CONSTRAINT `Resource_ibfk_2` FOREIGN KEY (`Group`) REFERENCES `ResourceGroup` (`Id`); 391 COMMIT; -
trunk/SQL/Update.php
r51 r57 82 82 PRIMARY KEY (`Id`) 83 83 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; 84 85 ALTER TABLE `MeetSource` ADD `Enabled` int(11) NOT NULL DEFAULT 1;
Note:
See TracChangeset
for help on using the changeset viewer.