- Timestamp:
- May 27, 2020, 8:04:56 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meet/Import/Amblar.php
r41 r57 29 29 { 30 30 $Output = parent::Import(); 31 $this->AddTimeInterval = 24 * 60 * 60; 31 32 $Content = file_get_contents($this->URL); 32 33 … … 56 57 if ($Type == 'odpovězeno') continue; 57 58 $MeetItem->Time = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>')); 58 if (mb_substr($MeetItem->Time, 0, 4) == 'před') 59 { 59 if (mb_substr($MeetItem->Time, 0, 4) == 'před') 60 { 60 61 $Parts = explode(' ', $MeetItem->Time); 61 62 if ($Parts[2] == 'hours') $MeetItem->Time = strtotime("-".$Parts[1]." hours"); … … 73 74 $MeetItem->Source = $this->Id; 74 75 $Output .= $this->ImportItem($MeetItem); 75 $this-> AddedCount += $MeetItem->AddIfNotExist(24 * 60 * 60);76 $this->MeetItems[] = $MeetItem; 76 77 } 77 78 return $Output; -
trunk/Modules/Meet/Import/AstraPraha.php
r37 r57 39 39 $MeetItem->Database = $this->Database; 40 40 $MeetItem->Source = $this->Id; 41 $this-> AddedCount += $MeetItem->AddIfNotExist();41 $this->MeetItems[] = $MeetItem; 42 42 } 43 43 return $Output; -
trunk/Modules/Meet/Import/Csts.php
r37 r57 45 45 $MeetItem->Database = $this->Database; 46 46 $MeetItem->Source = $this->Id; 47 $this-> AddedCount += $MeetItem->AddIfNotExist();47 $this->MeetItems[] = $MeetItem; 48 48 } 49 49 return $Output; -
trunk/Modules/Meet/Import/Ella.php
r45 r57 6 6 { 7 7 $Output = parent::Import(); 8 $this->AddCompareTime = false; 9 $this->AddCompareRemoteId = true; 8 10 $Content = file_get_contents($this->URL); 9 11 … … 38 40 $MeetItem->Database = $this->Database; 39 41 $MeetItem->Source = $this->Id; 40 $this-> AddedCount += $MeetItem->AddIfNotExist(0, false, true);42 $this->MeetItems[] = $MeetItem; 41 43 } 42 44 return $Output; -
trunk/Modules/Meet/Import/Eso.php
r37 r57 29 29 if (strpos($MeetItem->Gender, 'partnerku') !== false) $MeetItem->Gender = Gender::Male; 30 30 else if (strpos($MeetItem->Gender, 'partnera') !== false) $MeetItem->Gender = Gender::Female; 31 else $MeetItem->Gender = Gender::Undefined; 31 else $MeetItem->Gender = Gender::Undefined; 32 32 $Small = GetTextBetween($Item, '<small>', '</small>'); 33 if (strpos($Small, '/') != false){ 34 $MeetItem->Location = substr(trim(substr($Small, 0, strpos($Small, '/') - 1)), 1, -1); 35 $Small = substr($Small, strpos($Small, '/') + 1); 36 } 33 if (strpos($Small, '/') != false) 34 { 35 $MeetItem->Location = substr(trim(substr($Small, 0, strpos($Small, '/') - 1)), 1, -1); 36 $Small = substr($Small, strpos($Small, '/') + 1); 37 } 37 38 $MeetItem->Time = trim($Small); 38 39 $MeetItem->Time = HumanDateToTime($MeetItem->Time); 39 40 $MeetItem->Message = trim(GetTextBetween($Item, '<p class="lead">', '</p>')); 40 $MeetItem->Age = GetAgeFromText($MeetItem->Message); 41 $MeetItem->Age = GetAgeFromText($MeetItem->Message); 41 42 $MeetItem->Height = GetHeightFromText($MeetItem->Message); 42 43 $MeetItem->Weight = GetWeightFromText($MeetItem->Message); … … 49 50 $MeetItem->Database = $this->Database; 50 51 $MeetItem->Source = $this->Id; 51 $this-> AddedCount += $MeetItem->AddIfNotExist();52 $this->MeetItems[] = $MeetItem; 52 53 } 53 54 return $Output; -
trunk/Modules/Meet/Import/Facebook.php
r37 r57 5 5 function Import() 6 6 { 7 return; 7 return; 8 8 $Output = parent::Import(); 9 9 $Content = file_get_contents($this->URL); … … 36 36 $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm')); 37 37 $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, 'data-ft="{"tn":"K"}">', '</div>')))); 38 $MeetItem->Age = GetAgeFromText($MeetItem->Message); 38 $MeetItem->Age = GetAgeFromText($MeetItem->Message); 39 39 $MeetItem->Height = GetHeightFromText($MeetItem->Message); 40 40 $MeetItem->Weight = GetWeightFromText($MeetItem->Message); … … 48 48 $MeetItem->Database = $this->Database; 49 49 $MeetItem->Source = $this->Id; 50 $this-> AddedCount += $MeetItem->AddIfNotExist();50 $this->MeetItems[] = $MeetItem; 51 51 } 52 52 return $Output; -
trunk/Modules/Meet/Import/MajkluvSvet.php
r37 r57 48 48 $MeetItem->Database = $this->Database; 49 49 $MeetItem->Source = $this->Id; 50 $this-> AddedCount += $MeetItem->AddIfNotExist();50 $this->MeetItems[] = $MeetItem; 51 51 } 52 return $Output; 52 return $Output; 53 53 } 54 54 } -
trunk/Modules/Meet/Import/SalsaDance.php
r37 r57 40 40 $MeetItem->Database = $this->Database; 41 41 $MeetItem->Source = $this->Id; 42 $this-> AddedCount += $MeetItem->AddIfNotExist();42 $this->MeetItems[] = $MeetItem; 43 43 } 44 return $Output; 44 return $Output; 45 45 } 46 46 } -
trunk/Modules/Meet/Import/Seznamka.php
r54 r57 9 9 $Content = str_replace("(adsbygoogle = window.adsbygoogle || []).push({});", "", $Content); 10 10 $BlockStart = '<h1>Tanec ... : Seznamka</h1>'; 11 $BlockEnd = ' <h2>Doporučujeme</h2>';11 $BlockEnd = 'rel=\'prev\'>Předchozí</a>'; 12 12 $Content = GetTextBetween($Content, $BlockStart, $BlockEnd); 13 13 if ($Content == '') … … 50 50 $MeetItem->Database = $this->Database; 51 51 $MeetItem->Source = $this->Id; 52 $this-> AddedCount += $MeetItem->AddIfNotExist();52 $this->MeetItems[] = $MeetItem; 53 53 } 54 54 return $Output; -
trunk/Modules/Meet/Import/TanecniSkola.php
r37 r57 5 5 function Import() 6 6 { 7 $Output = '';7 $Output = parent::Import(); 8 8 $HeightRange = array( 9 9 '< 120 cm' => 120, … … 26 26 '200 cm <' => 205, 27 27 ); 28 29 $Output = parent::Import();30 28 $Content = file_get_contents($this->URL); 31 29 … … 92 90 $MeetItem->Database = $this->Database; 93 91 $MeetItem->Source = $this->Id; 94 $this-> AddedCount += $MeetItem->AddIfNotExist();92 $this->MeetItems[] = $MeetItem; 95 93 } 96 94 } -
trunk/Modules/Meet/Import/Vavruska.php
r43 r57 41 41 $MeetItem->Source = $this->Id; 42 42 if ($MeetItem->Name == 'Nový Design Inzerátů') continue; 43 $this-> AddedCount += $MeetItem->AddIfNotExist();43 $this->MeetItems[] = $MeetItem; 44 44 } 45 45 return $Output; -
trunk/Modules/Meet/Meet.php
r55 r57 326 326 { 327 327 $Output = ''; 328 if (($Id != null) and is_numeric($Id)) $Where = 'Id='.$Id;329 else $Where = '1';328 $Where = '(Enabled=1)'; 329 if (($Id != null) and is_numeric($Id)) $Where .= ' AND (Id='.$Id.')'; 330 330 $DbResult = $this->Database->select('MeetSource', '*', $Where); 331 331 while ($DbRow = $DbResult->fetch_assoc()) … … 353 353 $Source->Name = $DbRow['Name']; 354 354 $this->Items[] = $Source; 355 $Output .= $Source-> Import();355 $Output .= $Source->DoImport(); 356 356 } 357 357 return $Output; … … 366 366 public $Id; 367 367 public $Database; 368 public $MeetItems; 369 public $AddCompareTime; 370 public $AddCompareRemoteId; 371 public $AddTimeInterval; 372 public $AddedCount; 373 374 function __construct() 375 { 376 $this->MeetItems = array(); 377 $this->AddedCount = 0; 378 $this->AddCompareTime = true; 379 $this->AddCompareRemoteId = false; 380 $this->AddTimeInterval = 0; 381 } 368 382 369 383 function Import() 370 384 { 385 return ''; 386 } 387 388 function DoImport() 389 { 390 $this->MeetItems = array(); 371 391 $this->AddedCount = 0; 372 $Output = 'Parsing '.$this->Name.' ('.$this->Id.')...</br>'; 392 $Output = 'Parsing '.$this->Name.' (#'.$this->Id.')...'; 393 $Output .= $this->Import(); 394 $Output .= ' parsed: '.count($this->MeetItems); 395 foreach ($this->MeetItems as $MeetItem) 396 { 397 $this->AddedCount += $MeetItem->AddIfNotExist($this->AddTimeInterval, $this->AddCompareTime, $this->AddCompareRemoteId); 398 } 399 $Output .= ', new added: '.$this->AddedCount; 400 $Output .= '</br>'."\n"; 373 401 return $Output; 374 402 } -
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.