Changeset 57


Ignore:
Timestamp:
May 27, 2020, 8:04:56 PM (5 years ago)
Author:
chronos
Message:
  • Added: Allow to disable MeetSource in database.
  • Added: Show how many meet items were parsed and how many new added.
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Meet/Import/Amblar.php

    r41 r57  
    2929  {
    3030    $Output = parent::Import();
     31    $this->AddTimeInterval = 24 * 60 * 60;
    3132    $Content = file_get_contents($this->URL);
    3233
     
    5657      if ($Type == 'odpovězeno') continue;
    5758      $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      {
    6061        $Parts = explode(' ', $MeetItem->Time);
    6162        if ($Parts[2] == 'hours') $MeetItem->Time = strtotime("-".$Parts[1]." hours");
     
    7374      $MeetItem->Source = $this->Id;
    7475      $Output .= $this->ImportItem($MeetItem);
    75       $this->AddedCount += $MeetItem->AddIfNotExist(24 * 60 * 60);
     76      $this->MeetItems[] = $MeetItem;
    7677    }
    7778    return $Output;
  • trunk/Modules/Meet/Import/AstraPraha.php

    r37 r57  
    3939      $MeetItem->Database = $this->Database;
    4040      $MeetItem->Source = $this->Id;
    41       $this->AddedCount += $MeetItem->AddIfNotExist();
     41      $this->MeetItems[] = $MeetItem;
    4242    }
    4343    return $Output;
  • trunk/Modules/Meet/Import/Csts.php

    r37 r57  
    4545      $MeetItem->Database = $this->Database;
    4646      $MeetItem->Source = $this->Id;
    47       $this->AddedCount += $MeetItem->AddIfNotExist();
     47      $this->MeetItems[] = $MeetItem;
    4848    }
    4949    return $Output;
  • trunk/Modules/Meet/Import/Ella.php

    r45 r57  
    66  {
    77    $Output = parent::Import();
     8    $this->AddCompareTime = false;
     9    $this->AddCompareRemoteId = true;
    810    $Content = file_get_contents($this->URL);
    911
     
    3840      $MeetItem->Database = $this->Database;
    3941      $MeetItem->Source = $this->Id;
    40       $this->AddedCount += $MeetItem->AddIfNotExist(0, false, true);
     42      $this->MeetItems[] = $MeetItem;
    4143    }
    4244    return $Output;
  • trunk/Modules/Meet/Import/Eso.php

    r37 r57  
    2929      if (strpos($MeetItem->Gender, 'partnerku') !== false) $MeetItem->Gender = Gender::Male;
    3030        else if (strpos($MeetItem->Gender, 'partnera') !== false) $MeetItem->Gender = Gender::Female;
    31         else $MeetItem->Gender = Gender::Undefined;     
     31        else $MeetItem->Gender = Gender::Undefined;
    3232      $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      }
    3738      $MeetItem->Time = trim($Small);
    3839      $MeetItem->Time = HumanDateToTime($MeetItem->Time);
    3940      $MeetItem->Message = trim(GetTextBetween($Item, '<p class="lead">', '</p>'));
    40       $MeetItem->Age = GetAgeFromText($MeetItem->Message);     
     41      $MeetItem->Age = GetAgeFromText($MeetItem->Message);
    4142      $MeetItem->Height = GetHeightFromText($MeetItem->Message);
    4243      $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
     
    4950      $MeetItem->Database = $this->Database;
    5051      $MeetItem->Source = $this->Id;
    51       $this->AddedCount += $MeetItem->AddIfNotExist();
     52      $this->MeetItems[] = $MeetItem;
    5253    }
    5354    return $Output;
  • trunk/Modules/Meet/Import/Facebook.php

    r37 r57  
    55  function Import()
    66  {
    7     return;   
     7    return;
    88    $Output = parent::Import();
    99    $Content = file_get_contents($this->URL);
     
    3636      $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm'));
    3737      $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, 'data-ft="&#123;&quot;tn&quot;:&quot;K&quot;&#125;">', '</div>'))));
    38       $MeetItem->Age = GetAgeFromText($MeetItem->Message);     
     38      $MeetItem->Age = GetAgeFromText($MeetItem->Message);
    3939      $MeetItem->Height = GetHeightFromText($MeetItem->Message);
    4040      $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
     
    4848      $MeetItem->Database = $this->Database;
    4949      $MeetItem->Source = $this->Id;
    50       $this->AddedCount += $MeetItem->AddIfNotExist();
     50      $this->MeetItems[] = $MeetItem;
    5151    }
    5252    return $Output;
  • trunk/Modules/Meet/Import/MajkluvSvet.php

    r37 r57  
    4848      $MeetItem->Database = $this->Database;
    4949      $MeetItem->Source = $this->Id;
    50       $this->AddedCount += $MeetItem->AddIfNotExist();
     50      $this->MeetItems[] = $MeetItem;
    5151    }
    52     return $Output; 
     52    return $Output;
    5353  }
    5454}
  • trunk/Modules/Meet/Import/SalsaDance.php

    r37 r57  
    4040      $MeetItem->Database = $this->Database;
    4141      $MeetItem->Source = $this->Id;
    42       $this->AddedCount += $MeetItem->AddIfNotExist();
     42      $this->MeetItems[] = $MeetItem;
    4343    }
    44     return $Output; 
     44    return $Output;
    4545  }
    4646}
  • trunk/Modules/Meet/Import/Seznamka.php

    r54 r57  
    99    $Content = str_replace("(adsbygoogle = window.adsbygoogle || []).push({});", "", $Content);
    1010    $BlockStart = '<h1>Tanec ... : Seznamka</h1>';
    11     $BlockEnd = '<h2>Doporučujeme</h2>';
     11    $BlockEnd = 'rel=\'prev\'>Předchozí</a>';
    1212    $Content = GetTextBetween($Content, $BlockStart, $BlockEnd);
    1313    if ($Content == '')
     
    5050      $MeetItem->Database = $this->Database;
    5151      $MeetItem->Source = $this->Id;
    52       $this->AddedCount += $MeetItem->AddIfNotExist();
     52      $this->MeetItems[] = $MeetItem;
    5353    }
    5454    return $Output;
  • trunk/Modules/Meet/Import/TanecniSkola.php

    r37 r57  
    55  function Import()
    66  {
    7     $Output = '';
     7    $Output = parent::Import();
    88    $HeightRange = array(
    99      '< 120 cm' => 120,
     
    2626      '200 cm <' => 205,
    2727    );
    28 
    29     $Output = parent::Import();
    3028    $Content = file_get_contents($this->URL);
    3129
     
    9290        $MeetItem->Database = $this->Database;
    9391        $MeetItem->Source = $this->Id;
    94         $this->AddedCount += $MeetItem->AddIfNotExist();
     92        $this->MeetItems[] = $MeetItem;
    9593      }
    9694    }
  • trunk/Modules/Meet/Import/Vavruska.php

    r43 r57  
    4141      $MeetItem->Source = $this->Id;
    4242      if ($MeetItem->Name == 'Nový Design Inzerátů') continue;
    43       $this->AddedCount += $MeetItem->AddIfNotExist();
     43      $this->MeetItems[] = $MeetItem;
    4444    }
    4545    return $Output;
  • trunk/Modules/Meet/Meet.php

    r55 r57  
    326326  {
    327327    $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.')';
    330330    $DbResult = $this->Database->select('MeetSource', '*', $Where);
    331331    while ($DbRow = $DbResult->fetch_assoc())
     
    353353      $Source->Name = $DbRow['Name'];
    354354      $this->Items[] = $Source;
    355       $Output .= $Source->Import();
     355      $Output .= $Source->DoImport();
    356356    }
    357357    return $Output;
     
    366366  public $Id;
    367367  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  }
    368382
    369383  function Import()
    370384  {
     385    return '';
     386  }
     387
     388  function DoImport()
     389  {
     390    $this->MeetItems = array();
    371391    $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";
    373401    return $Output;
    374402  }
  • 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
     10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
     11SET AUTOCOMMIT = 0;
     12START TRANSACTION;
     13SET time_zone = "+00:00";
     14
     15--
     16-- Databáze: `tanec`
     17--
     18
     19-- --------------------------------------------------------
     20
     21--
     22-- Struktura tabulky `Dance`
     23--
     24
     25CREATE 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
     37CREATE TABLE `DanceFigure` (
     38  `Id` int(11) NOT NULL,
    2939  `NameCz` varchar(255) NOT NULL,
    3040  `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
     50CREATE 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
     61CREATE TABLE `Event` (
     62  `Id` int(11) NOT NULL,
    5263  `TimeFrom` datetime DEFAULT NULL,
    5364  `TimeTo` datetime DEFAULT NULL,
     
    6071  `Location` varchar(255) DEFAULT NULL,
    6172  `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
     82CREATE TABLE `EventSource` (
     83  `Id` int(11) NOT NULL,
    7284  `Name` varchar(255) DEFAULT NULL,
    7385  `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
     95CREATE TABLE `MeetItem` (
     96  `Id` int(11) NOT NULL,
    8397  `Message` text NOT NULL,
    8498  `Name` varchar(255) NOT NULL,
     
    95109  `TimeImport` datetime DEFAULT NULL,
    96110  `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
     120CREATE TABLE `MeetSource` (
     121  `Id` int(11) NOT NULL,
    109122  `Name` varchar(255) NOT NULL,
    110123  `URL` varchar(255) NOT NULL,
    111124  `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
     134CREATE TABLE `Movie` (
     135  `Id` int(11) NOT NULL,
    120136  `NameCz` varchar(255) NOT NULL,
    121137  `NameEn` varchar(255) NOT NULL,
    122138  `Year` int(11) NOT NULL,
    123139  `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
     149CREATE TABLE `Music` (
     150  `Id` int(11) NOT NULL,
    134151  `Name` varchar(255) NOT NULL,
    135152  `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
     162CREATE TABLE `Resource` (
     163  `Id` int(11) NOT NULL,
    147164  `Name` varchar(255) NOT NULL,
    148165  `Dance` int(11) NOT NULL,
    149166  `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
     176CREATE 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
     188CREATE TABLE `School` (
     189  `Id` int(11) NOT NULL,
    173190  `Name` varchar(255) NOT NULL,
    174191  `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--
     202ALTER TABLE `Dance`
     203  ADD PRIMARY KEY (`Id`),
     204  ADD KEY `Group` (`Group`);
     205
     206--
     207-- Klíče pro tabulku `DanceFigure`
     208--
     209ALTER 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--
     217ALTER TABLE `DanceGroup`
     218  ADD PRIMARY KEY (`Id`);
     219
     220--
     221-- Klíče pro tabulku `Event`
     222--
     223ALTER TABLE `Event`
     224  ADD PRIMARY KEY (`Id`),
     225  ADD KEY `Source` (`Source`);
     226
     227--
     228-- Klíče pro tabulku `EventSource`
     229--
     230ALTER TABLE `EventSource`
     231  ADD PRIMARY KEY (`Id`);
     232
     233--
     234-- Klíče pro tabulku `MeetItem`
     235--
     236ALTER 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--
     244ALTER TABLE `MeetSource`
     245  ADD PRIMARY KEY (`Id`);
     246
     247--
     248-- Klíče pro tabulku `Movie`
     249--
     250ALTER TABLE `Movie`
     251  ADD PRIMARY KEY (`Id`),
     252  ADD KEY `Year` (`Year`);
     253
     254--
     255-- Klíče pro tabulku `Music`
     256--
     257ALTER TABLE `Music`
     258  ADD PRIMARY KEY (`Id`),
     259  ADD KEY `Dance` (`Dance`);
     260
     261--
     262-- Klíče pro tabulku `Resource`
     263--
     264ALTER 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--
     272ALTER TABLE `ResourceGroup`
     273  ADD PRIMARY KEY (`Id`);
     274
     275--
     276-- Klíče pro tabulku `School`
     277--
     278ALTER TABLE `School`
     279  ADD PRIMARY KEY (`Id`);
     280
     281--
     282-- AUTO_INCREMENT pro tabulky
     283--
     284
     285--
     286-- AUTO_INCREMENT pro tabulku `Dance`
     287--
     288ALTER TABLE `Dance`
     289  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     290
     291--
     292-- AUTO_INCREMENT pro tabulku `DanceFigure`
     293--
     294ALTER TABLE `DanceFigure`
     295  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     296
     297--
     298-- AUTO_INCREMENT pro tabulku `DanceGroup`
     299--
     300ALTER TABLE `DanceGroup`
     301  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     302
     303--
     304-- AUTO_INCREMENT pro tabulku `Event`
     305--
     306ALTER TABLE `Event`
     307  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     308
     309--
     310-- AUTO_INCREMENT pro tabulku `EventSource`
     311--
     312ALTER TABLE `EventSource`
     313  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     314
     315--
     316-- AUTO_INCREMENT pro tabulku `MeetItem`
     317--
     318ALTER TABLE `MeetItem`
     319  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     320
     321--
     322-- AUTO_INCREMENT pro tabulku `MeetSource`
     323--
     324ALTER TABLE `MeetSource`
     325  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     326
     327--
     328-- AUTO_INCREMENT pro tabulku `Movie`
     329--
     330ALTER TABLE `Movie`
     331  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     332
     333--
     334-- AUTO_INCREMENT pro tabulku `Music`
     335--
     336ALTER TABLE `Music`
     337  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     338
     339--
     340-- AUTO_INCREMENT pro tabulku `Resource`
     341--
     342ALTER TABLE `Resource`
     343  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     344
     345--
     346-- AUTO_INCREMENT pro tabulku `ResourceGroup`
     347--
     348ALTER TABLE `ResourceGroup`
     349  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
     350
     351--
     352-- AUTO_INCREMENT pro tabulku `School`
     353--
     354ALTER 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--
     364ALTER TABLE `Dance`
     365  ADD CONSTRAINT `Dance_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `DanceGroup` (`Id`);
     366
     367--
     368-- Omezení pro tabulku `DanceFigure`
     369--
     370ALTER TABLE `DanceFigure`
     371  ADD CONSTRAINT `DanceFigure_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`);
     372
     373--
     374-- Omezení pro tabulku `MeetItem`
     375--
     376ALTER TABLE `MeetItem`
     377  ADD CONSTRAINT `MeetItem_ibfk_1` FOREIGN KEY (`Source`) REFERENCES `MeetSource` (`Id`);
     378
     379--
     380-- Omezení pro tabulku `Music`
     381--
     382ALTER TABLE `Music`
     383  ADD CONSTRAINT `Music_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`);
     384
     385--
     386-- Omezení pro tabulku `Resource`
     387--
     388ALTER 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`);
     391COMMIT;
  • trunk/SQL/Update.php

    r51 r57  
    8282  PRIMARY KEY (`Id`)
    8383) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
     84
     85ALTER TABLE `MeetSource` ADD `Enabled` int(11) NOT NULL DEFAULT 1;
Note: See TracChangeset for help on using the changeset viewer.