/*M!999999\- enable the sandbox mode */ 

/*!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 utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `CMSMETA`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `CMSMETA` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `klucz` varchar(16) NOT NULL,
  `wartosc` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `CMSUD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `CMSUD` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `czas` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `email` varchar(32) NOT NULL,
  `monety` int(11) NOT NULL DEFAULT 1000,
  `nick` varchar(32) DEFAULT NULL,
  `imie` text DEFAULT NULL,
  `awatar` text NOT NULL,
  `lastLogin` int(11) DEFAULT NULL,
  `mnoznikKup` double(5,2) NOT NULL DEFAULT 1.00,
  `mnoznikSprzedaj` double(4,2) NOT NULL DEFAULT 2.00,
  `minPunktyKup` int(11) DEFAULT NULL,
  `minPunktySprzedaj` int(11) DEFAULT NULL,
  `zaleceniaBlokadaDni` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nick` (`nick`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `antytickery`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `antytickery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `czas` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`)
) ENGINE=InnoDB AUTO_INCREMENT=756 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `brokerzy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `brokerzy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nazwa` varchar(10) NOT NULL,
  `silnik` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `brokerzyTickeryMapa`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `brokerzyTickeryMapa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idBrokerzy` int(11) NOT NULL,
  `od` varchar(4) NOT NULL,
  `do` varchar(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `dywidendy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `dywidendy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `data` date NOT NULL,
  `kwota` double(7,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=2018791 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `flagi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `flagi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `typ` varchar(1) DEFAULT NULL,
  `nazwa` text DEFAULT NULL,
  `logo` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `flagiTickery`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `flagiTickery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `UID` int(11) NOT NULL,
  `idFlagi` int(11) NOT NULL,
  `ticker` varchar(16) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UID` (`UID`,`idFlagi`,`ticker`)
) ENGINE=InnoDB AUTO_INCREMENT=974 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `gieldy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `gieldy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dziala` int(11) NOT NULL DEFAULT 1,
  `yGielda` varchar(3) DEFAULT NULL,
  `Yahoo` text DEFAULT NULL,
  `TV` text DEFAULT NULL,
  `EODHD` text DEFAULT NULL,
  `GuruFocus` text DEFAULT NULL,
  `Investing` text DEFAULT NULL,
  `XTB` text DEFAULT NULL,
  `Google` text DEFAULT NULL,
  `TipRanks` text DEFAULT NULL,
  `ticker` varchar(16) DEFAULT NULL,
  `TZ` text DEFAULT NULL,
  `od` time DEFAULT NULL,
  `do` time DEFAULT NULL,
  `dni` int(11) DEFAULT NULL,
  `swiecaM` int(11) DEFAULT NULL,
  `swiecaW` int(11) DEFAULT NULL,
  `swiecaD` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `yGielda` (`yGielda`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `handel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `handel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idPozycje` int(11) NOT NULL,
  `idKonta` int(11) DEFAULT NULL,
  `ticker` text DEFAULT NULL,
  `czas` int(11) NOT NULL,
  `ilosc` double(8,4) NOT NULL,
  `cena` double(9,2) NOT NULL,
  `wartosc` double(9,2) GENERATED ALWAYS AS (`ilosc` * `cena`) STORED,
  `idTransakcja` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16793 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `historia`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `historia` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idKonta` int(11) NOT NULL,
  `data` date NOT NULL,
  `wartosc` double(10,2) DEFAULT NULL,
  `saldo` double(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idKonta` (`idKonta`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=119153 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `holdings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `holdings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `eTicker` varchar(16) NOT NULL,
  `hTicker` varchar(16) NOT NULL,
  `procent` double(4,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tickerETF` (`eTicker`,`hTicker`)
) ENGINE=InnoDB AUTO_INCREMENT=479432 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `kHandel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kHandel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idPozycje` int(11) NOT NULL,
  `idKonta` int(11) DEFAULT NULL,
  `ticker` text DEFAULT NULL,
  `czas` int(11) NOT NULL,
  `ilosc` double(8,4) NOT NULL,
  `cena` double(9,2) NOT NULL,
  `idTransakcja` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11547 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `kPozycje`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kPozycje` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sprawdzona` int(11) DEFAULT NULL,
  `isOpen` int(11) DEFAULT 1,
  `idKonta` int(11) NOT NULL,
  `ticker` varchar(16) NOT NULL,
  `tickerBroker` text DEFAULT NULL,
  `czasInterakcja` int(11) DEFAULT NULL,
  `odKiedy` int(11) DEFAULT NULL,
  `waga` int(11) NOT NULL DEFAULT 0,
  `wolumen` double(14,8) DEFAULT NULL,
  `open` double(9,2) DEFAULT NULL,
  `close` double(9,2) DEFAULT NULL,
  `ilosc` int(11) DEFAULT NULL,
  `inwestycja` double(9,2) DEFAULT NULL,
  `wartosc` double(9,2) GENERATED ALWAYS AS (`wolumen` * `close`) STORED,
  `bilans` double(9,2) DEFAULT NULL,
  `zwrot` double(5,2) GENERATED ALWAYS AS ((`close` / nullif(`open`,0) - 1) * 100) STORED,
  `zrodlo` text DEFAULT NULL,
  `zaleceniaBlokada` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `kontaTicker` (`idKonta`,`ticker`),
  KEY `ticker` (`ticker`),
  KEY `kontaBlokada` (`idKonta`,`zaleceniaBlokada`)
) ENGINE=InnoDB AUTO_INCREMENT=10560 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `kTickery`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kTickery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `shortName` text DEFAULT NULL,
  `yGielda` varchar(3) DEFAULT NULL,
  `ISIN` varchar(12) DEFAULT NULL,
  `logo` text DEFAULT NULL,
  `obserwowane` int(11) DEFAULT NULL,
  `posiadane` int(11) DEFAULT NULL,
  `typy` set('Klasa','ETF','REIT','Holding','DR/OTC') NOT NULL,
  `XXXisKlasa` int(11) DEFAULT NULL,
  `XXXisETF` int(11) DEFAULT NULL,
  `XXXisREIT` int(11) DEFAULT NULL,
  `odznaki` set('SUP','SRev','SInc','SDIV','RDIV','Prognoza') NOT NULL DEFAULT '',
  `nazwa` text DEFAULT NULL,
  `opis` text DEFAULT NULL,
  `cena` double(10,2) DEFAULT NULL,
  `aktualna` double(10,2) DEFAULT NULL,
  `zmiana` double(6,4) GENERATED ALWAYS AS (`aktualna` / `cena` - 1) STORED,
  `cenaFV` double(10,2) DEFAULT NULL,
  `cenaATH` double(10,2) DEFAULT NULL,
  `dataATH` date DEFAULT NULL,
  `cenaLTL` double(10,2) DEFAULT NULL,
  `dataLTL` date DEFAULT NULL,
  `waluta` varchar(3) DEFAULT NULL,
  `rynek` int(11) DEFAULT NULL,
  `czasTA` int(11) DEFAULT NULL,
  `czasFA` int(11) DEFAULT NULL,
  `czasGFS` int(11) DEFAULT NULL,
  `czasGFCAPE` int(11) DEFAULT NULL,
  `czasIC` int(11) DEFAULT NULL,
  `swiecaD` date DEFAULT NULL,
  `swiecaW` date DEFAULT NULL,
  `swiecaM` date DEFAULT NULL,
  `swiecaProbaI` int(11) DEFAULT NULL,
  `swiecaProbaD` int(11) DEFAULT NULL,
  `swiecaProbaW` int(11) DEFAULT NULL,
  `swiecaProbaM` int(11) DEFAULT NULL,
  `dywidendyBlokada` int(11) DEFAULT NULL,
  `branza` text DEFAULT NULL,
  `typ` text DEFAULT NULL,
  `wagaT` int(11) DEFAULT NULL,
  `wagaF` int(11) DEFAULT NULL,
  `wagaZ` int(11) DEFAULT NULL,
  `wagaAZS` int(11) DEFAULT NULL,
  `wagaG` int(11) DEFAULT NULL,
  `wagaGF` int(11) DEFAULT NULL,
  `wagaC` int(11) DEFAULT NULL,
  `wagaP` int(11) DEFAULT NULL,
  `wagaR` int(11) DEFAULT NULL,
  `wagaD` int(11) DEFAULT NULL,
  `wagaRD` int(11) DEFAULT NULL,
  `wagaSuma` int(11) DEFAULT NULL,
  `wagaPlus` int(11) DEFAULT NULL,
  `wagaMinus` int(11) DEFAULT NULL,
  `YoYWzrost` double(5,3) GENERATED ALWAYS AS ((`YoYTR` + `YoYOI` + `YoYFCF`) / 3) STORED,
  `YoYTR` double(5,3) DEFAULT NULL,
  `YoYOI` double(5,3) DEFAULT NULL,
  `YoYFCF` double(5,3) DEFAULT NULL,
  `zmianaY` double(5,3) DEFAULT NULL,
  `bEPS` double(11,2) DEFAULT NULL,
  `fEPS` double(11,2) DEFAULT NULL,
  `cAssets` double(10,3) DEFAULT NULL,
  `tAssets` double(10,3) DEFAULT NULL,
  `tLiabilities` double(10,3) DEFAULT NULL,
  `nIncome` double(12,3) DEFAULT NULL,
  `tRevenue` double(12,3) DEFAULT NULL,
  `expenses` double(12,3) DEFAULT NULL,
  `FFO` double(12,3) DEFAULT NULL,
  `WC` double(10,3) DEFAULT NULL,
  `RE` double(10,3) DEFAULT NULL,
  `EBIT` double(10,3) DEFAULT NULL,
  `EBITDA` double(10,3) DEFAULT NULL,
  `MC` double(10,3) DEFAULT NULL,
  `oscylatorD` int(11) DEFAULT NULL,
  `oscylatorW` int(11) DEFAULT NULL,
  `oscylatorM` int(11) DEFAULT NULL,
  `silaD` int(11) DEFAULT NULL,
  `silaW` int(11) DEFAULT NULL,
  `silaM` int(11) DEFAULT NULL,
  `sygnalD` int(11) DEFAULT NULL,
  `sygnalW` int(11) DEFAULT NULL,
  `sygnalM` int(11) DEFAULT NULL,
  `LRD` double(4,2) DEFAULT NULL,
  `LRW` double(4,2) DEFAULT NULL,
  `LRM` double(4,2) DEFAULT NULL,
  `SDM` double(10,2) DEFAULT NULL,
  `SDxD` float(3,2) DEFAULT NULL,
  `SDxW` float(3,2) DEFAULT NULL,
  `SDxM` float(3,2) DEFAULT NULL,
  `maxSDxD` double(2,1) DEFAULT NULL,
  `maxSDxW` double(2,1) DEFAULT NULL,
  `maxSDxM` double(2,1) DEFAULT NULL,
  `PE` double(5,2) DEFAULT NULL,
  `fPE` double(5,2) DEFAULT NULL,
  `PS` double(5,2) DEFAULT NULL,
  `PB` double(5,2) DEFAULT NULL,
  `PFFO` double(5,2) DEFAULT NULL,
  `DE` double(6,2) DEFAULT NULL,
  `QR` double(5,2) DEFAULT NULL,
  `GM` double(3,2) DEFAULT NULL,
  `OM` double(3,2) DEFAULT NULL,
  `AZS` double(5,2) DEFAULT NULL,
  `GR` double(4,2) DEFAULT NULL,
  `cash` double(10,5) DEFAULT NULL,
  `DF` int(11) DEFAULT NULL,
  `DR` double(7,5) DEFAULT NULL,
  `dywidendaProcent` double(7,5) DEFAULT NULL,
  `PR` double(5,2) DEFAULT NULL,
  `beta` double(4,2) DEFAULT NULL,
  `CAPE` double(4,2) DEFAULT NULL,
  `CAGR1` double(4,1) DEFAULT NULL,
  `CAGR3` double(4,1) DEFAULT NULL,
  `CAGR5` double(4,1) DEFAULT NULL,
  `CAGR7` double(4,1) DEFAULT NULL,
  `CAGR10` double(4,1) DEFAULT NULL,
  `GFS` int(11) DEFAULT NULL,
  `FTE` int(11) DEFAULT NULL,
  `prognozaIlosc` int(11) DEFAULT NULL,
  `prognozaMin` double(9,2) DEFAULT NULL,
  `prognozaMid` double(9,2) DEFAULT NULL,
  `prognozaMed` double(9,2) DEFAULT NULL,
  `prognozaMax` double(9,2) DEFAULT NULL,
  `prognozaLR` double(9,2) DEFAULT NULL,
  `prognozaIC` double(9,2) DEFAULT NULL,
  `rekomendacja` text DEFAULT NULL,
  `okno` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`),
  KEY `zmiana` (`zmiana`)
) ENGINE=InnoDB AUTO_INCREMENT=14459 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `kTrollbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kTrollbox` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nick` varchar(16) NOT NULL,
  `czas` int(11) NOT NULL,
  `tresc` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=741 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `konta`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `konta` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `isAutomatic` int(1) DEFAULT NULL,
  `UID` int(11) NOT NULL,
  `idSubkonta` int(11) DEFAULT NULL,
  `idStrategie` int(11) DEFAULT NULL,
  `nazwa` text DEFAULT NULL,
  `login` text DEFAULT NULL,
  `haslo` text DEFAULT NULL,
  `czasAktualizacja` int(11) DEFAULT NULL,
  `waluta` varchar(3) DEFAULT NULL,
  `saldo` double(10,2) DEFAULT NULL,
  `ilosc` int(11) DEFAULT NULL,
  `inwestycja` double(9,2) DEFAULT NULL,
  `wartosc` double(9,2) DEFAULT NULL,
  `bilans` double(9,2) DEFAULT NULL,
  `prognoza` double(9,2) DEFAULT NULL,
  `zaleceniaBlokadaDni` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `monety`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `monety` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `UID` int(11) NOT NULL,
  `czas` int(11) NOT NULL,
  `kwota` int(11) NOT NULL,
  `saldo` int(11) NOT NULL,
  `tytul` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5767 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `notatnik`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `notatnik` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `UID` int(11) NOT NULL,
  `tresc` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UID` (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `platnosci`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `platnosci` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `czasStart` int(11) NOT NULL,
  `czasAktualizacja` int(11) DEFAULT NULL,
  `UID` int(11) NOT NULL,
  `operator` enum('stripe','opennode') NOT NULL,
  `OID` varchar(120) DEFAULT NULL,
  `kwota` text NOT NULL,
  `waluta` varchar(3) NOT NULL,
  `monety` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `pozycje`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pozycje` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `isOpen` int(11) DEFAULT 1,
  `idKonta` int(11) NOT NULL,
  `ticker` varchar(16) NOT NULL,
  `tickerBroker` text DEFAULT NULL,
  `czasInterakcja` int(11) DEFAULT NULL,
  `odKiedy` int(11) DEFAULT NULL,
  `waga` int(11) NOT NULL DEFAULT 0,
  `wolumen` double(14,8) DEFAULT NULL,
  `open` double(9,2) DEFAULT NULL,
  `close` double(9,2) DEFAULT NULL,
  `ilosc` int(11) DEFAULT NULL,
  `inwestycja` double(9,2) DEFAULT NULL,
  `wartosc` double(9,2) GENERATED ALWAYS AS (`wolumen` * `close`) STORED,
  `bilans` double(9,2) DEFAULT NULL,
  `zwrot` double(5,2) GENERATED ALWAYS AS ((`close` / nullif(`open`,0) - 1) * 100) STORED,
  `prognoza` double(9,2) DEFAULT NULL,
  `zrodlo` text DEFAULT NULL,
  `zaleceniaBlokada` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `kontaTicker` (`idKonta`,`ticker`),
  KEY `ticker` (`ticker`),
  KEY `kontaBlokada` (`idKonta`,`zaleceniaBlokada`)
) ENGINE=InnoDB AUTO_INCREMENT=11004 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `raporty`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `raporty` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `typ` int(11) NOT NULL,
  `data` date NOT NULL,
  `cena` double(8,2) DEFAULT NULL,
  `tRevenue` double(12,3) DEFAULT NULL,
  `COGS` double(12,3) DEFAULT NULL,
  `nIncome` double(12,3) DEFAULT NULL,
  `oIncome` double(12,3) DEFAULT NULL,
  `depreciation` double(12,3) DEFAULT NULL,
  `EBITDA` double(12,3) DEFAULT NULL,
  `GOSP` double(12,3) DEFAULT NULL,
  `FCF` double(12,3) DEFAULT NULL,
  `TBV` double(12,3) DEFAULT NULL,
  `bEPS` float(11,2) DEFAULT NULL,
  `akcje` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`,`typ`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=11432954 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `strategie`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `strategie` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nazwa` varchar(11) NOT NULL,
  `opis` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `subkonta`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `subkonta` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idBrokerzy` int(11) NOT NULL,
  `czyDemo` int(11) DEFAULT NULL,
  `nazwa` text NOT NULL,
  `waluta` varchar(3) DEFAULT NULL,
  `logo` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `swiece`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `swiece` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `typ` varchar(1) NOT NULL,
  `data` date NOT NULL,
  `low` double(10,2) DEFAULT NULL,
  `high` double(10,2) DEFAULT NULL,
  `close` double(10,2) DEFAULT NULL,
  `oscylator` int(11) DEFAULT NULL,
  `sila` int(11) DEFAULT NULL,
  `sygnal` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique` (`ticker`,`typ`,`data`),
  KEY `ticker` (`ticker`),
  KEY `typ` (`typ`),
  KEY `data` (`data`)
) ENGINE=InnoDB AUTO_INCREMENT=375849134 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tasklist`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `tasklist` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `UID` int(11) NOT NULL,
  `tresc` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tickery`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `tickery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `shortName` text DEFAULT NULL,
  `yGielda` varchar(3) DEFAULT NULL,
  `ISIN` varchar(12) DEFAULT NULL,
  `logo` text DEFAULT NULL,
  `typy` set('Klasa','ETF','HYETF','REIT','Holding','DR/OTC') NOT NULL DEFAULT '',
  `odznaki` set('SUP','SRev','SInc','SDIV','RDIV','Prognoza') NOT NULL DEFAULT '',
  `nazwa` text DEFAULT NULL,
  `opis` text DEFAULT NULL,
  `cena` double(10,2) DEFAULT NULL,
  `aktualna` double(10,2) DEFAULT NULL,
  `cenaOstatnia` double(10,2) GENERATED ALWAYS AS (ifnull(`aktualna`,`cena`)) STORED,
  `zmiana` double(6,4) GENERATED ALWAYS AS (`aktualna` / `cena` - 1) STORED,
  `cenaFV` double(10,2) DEFAULT NULL,
  `cenaATH` double(10,2) DEFAULT NULL,
  `dataATH` date DEFAULT NULL,
  `cenaLTL` double(10,2) DEFAULT NULL,
  `dataLTL` date DEFAULT NULL,
  `waluta` varchar(3) DEFAULT NULL,
  `rynek` int(11) DEFAULT NULL,
  `czasTA` int(11) DEFAULT NULL,
  `czasFA` int(11) DEFAULT NULL,
  `czasGFS` int(11) DEFAULT NULL,
  `czasGFCAPE` int(11) DEFAULT NULL,
  `czasIC` int(11) DEFAULT NULL,
  `swiecaD` date DEFAULT NULL,
  `swiecaW` date DEFAULT NULL,
  `swiecaM` date DEFAULT NULL,
  `swiecaProbaI` int(11) DEFAULT NULL,
  `swiecaProbaD` int(11) DEFAULT NULL,
  `swiecaProbaW` int(11) DEFAULT NULL,
  `swiecaProbaM` int(11) DEFAULT NULL,
  `dywidendyBlokada` int(11) DEFAULT NULL,
  `branza` text DEFAULT NULL,
  `typ` text DEFAULT NULL,
  `wagaT` int(11) DEFAULT NULL,
  `wagaF` int(11) DEFAULT NULL,
  `wagaZ` int(11) DEFAULT NULL,
  `wagaAZS` int(11) DEFAULT NULL,
  `wagaG` int(11) DEFAULT NULL,
  `wagaGF` int(11) DEFAULT NULL,
  `wagaC` int(11) DEFAULT NULL,
  `wagaP` int(11) DEFAULT NULL,
  `wagaR` int(11) DEFAULT NULL,
  `wagaD` int(11) DEFAULT NULL,
  `wagaRD` int(11) DEFAULT NULL,
  `wagaSuma` int(11) DEFAULT NULL,
  `wagaPlus` int(11) DEFAULT NULL,
  `wagaMinus` int(11) DEFAULT NULL,
  `YoYTR` double(5,3) DEFAULT NULL,
  `YoYOI` double(5,3) DEFAULT NULL,
  `YoYFCF` double(5,3) DEFAULT NULL,
  `zmianaY` double(5,3) DEFAULT NULL,
  `bEPS` double(11,2) DEFAULT NULL,
  `fEPS` double(11,2) DEFAULT NULL,
  `cAssets` double(10,3) DEFAULT NULL,
  `tAssets` double(10,3) DEFAULT NULL,
  `tLiabilities` double(10,3) DEFAULT NULL,
  `nIncome` double(12,3) DEFAULT NULL,
  `tRevenue` double(12,3) DEFAULT NULL,
  `expenses` double(12,3) DEFAULT NULL,
  `FFO` double(12,3) DEFAULT NULL,
  `WC` double(10,3) DEFAULT NULL,
  `RE` double(10,3) DEFAULT NULL,
  `EBIT` double(10,3) DEFAULT NULL,
  `EBITDA` double(10,3) DEFAULT NULL,
  `MC` double(10,3) DEFAULT NULL,
  `oscylatorD` int(11) DEFAULT NULL,
  `oscylatorW` int(11) DEFAULT NULL,
  `oscylatorM` int(11) DEFAULT NULL,
  `silaD` int(11) DEFAULT NULL,
  `silaW` int(11) DEFAULT NULL,
  `silaM` int(11) DEFAULT NULL,
  `sygnalD` int(11) DEFAULT NULL,
  `sygnalW` int(11) DEFAULT NULL,
  `sygnalM` int(11) DEFAULT NULL,
  `LRD` double(4,2) DEFAULT NULL,
  `LRW` double(4,2) DEFAULT NULL,
  `LRM` double(4,2) DEFAULT NULL,
  `SDM` double(10,2) DEFAULT NULL,
  `SDxD` float(3,2) DEFAULT NULL,
  `SDxW` float(3,2) DEFAULT NULL,
  `SDxM` float(3,2) DEFAULT NULL,
  `maxSDxD` double(2,1) DEFAULT NULL,
  `maxSDxW` double(2,1) DEFAULT NULL,
  `maxSDxM` double(2,1) DEFAULT NULL,
  `PE` double(5,2) DEFAULT NULL,
  `fPE` double(5,2) DEFAULT NULL,
  `PS` double(5,2) DEFAULT NULL,
  `PB` double(5,2) DEFAULT NULL,
  `PFFO` double(5,2) DEFAULT NULL,
  `DE` double(6,2) DEFAULT NULL,
  `QR` double(5,2) DEFAULT NULL,
  `GM` double(3,2) DEFAULT NULL,
  `OM` double(3,2) DEFAULT NULL,
  `AZS` double(5,2) DEFAULT NULL,
  `GR` double(4,2) DEFAULT NULL,
  `cash` double(10,5) DEFAULT NULL,
  `DF` int(11) DEFAULT NULL,
  `DR` double(7,5) DEFAULT NULL,
  `dywidendaProcent` double(7,5) DEFAULT NULL,
  `PR` double(5,2) DEFAULT NULL,
  `beta` double(4,2) DEFAULT NULL,
  `CAPE` double(4,2) DEFAULT NULL,
  `CAGR1` double(4,1) DEFAULT NULL,
  `CAGR3` double(4,1) DEFAULT NULL,
  `CAGR5` double(4,1) DEFAULT NULL,
  `CAGR7` double(4,1) DEFAULT NULL,
  `CAGR10` double(4,1) DEFAULT NULL,
  `GFS` int(11) DEFAULT NULL,
  `FTE` int(11) DEFAULT NULL,
  `prognozaIlosc` int(11) DEFAULT NULL,
  `prognozaMin` double(9,2) DEFAULT NULL,
  `prognozaMid` double(9,2) DEFAULT NULL,
  `prognozaMed` double(9,2) DEFAULT NULL,
  `prognozaMax` double(9,2) DEFAULT NULL,
  `prognozaLR` double(9,2) DEFAULT NULL,
  `prognozaIC` double(9,2) DEFAULT NULL,
  `prognozaGT` double(9,2) GENERATED ALWAYS AS (ifnull((`prognozaMin` + least(`prognozaMid`,`prognozaMed`)) / 2,`cena`)) STORED,
  `rekomendacja` text DEFAULT NULL,
  `okno` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`),
  KEY `zmiana` (`zmiana`)
) ENGINE=InnoDB AUTO_INCREMENT=14948 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tickeryBrokerzy`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `tickeryBrokerzy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idBrokerzy` int(11) NOT NULL,
  `ticker` varchar(12) NOT NULL,
  `tickerBroker` varchar(12) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idBrokerzy` (`idBrokerzy`,`ticker`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tickeryErrory`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `tickeryErrory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticker` varchar(16) NOT NULL,
  `czas` int(11) NOT NULL,
  `error` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticker` (`ticker`)
) ENGINE=InnoDB AUTO_INCREMENT=2071044 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `trollbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `trollbox` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `UID` int(11) NOT NULL,
  `czas` int(11) NOT NULL,
  `tresc` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=993 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ustawienia`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ustawienia` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `klucz` varchar(24) NOT NULL,
  `wartosc` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `klucz` (`klucz`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

