-- https://www.phpmyadmin.net/
--




--
-- Database: `test_swedish_db`
--

-- --------------------------------------------------------

--
-- Table structure for table `bots`
--

CREATE TABLE `bots` (
  `id` int(11) NOT NULL,
  `username` text NOT NULL,
  `token` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dictionary`
--

CREATE TABLE `dictionary` (
  `id` int(11) NOT NULL,
  `artikel` varchar(10) NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `plural` text CHARACTER SET utf8 NOT NULL,
  `reflexive` tinyint(1) NOT NULL,
  `translation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `example` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `exampletranslation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `status` text CHARACTER SET utf8 NOT NULL,
  `soundFile` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `translationrate` int(11) NOT NULL,
  `searchedWord` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `dictionary_merged`
--

CREATE TABLE `dictionary_merged` (
  `id` int(11) NOT NULL,
  `artikel` varchar(10) NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `type` varchar(20) NOT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `plural` text CHARACTER SET utf8 NOT NULL,
  `reflexive` tinyint(1) NOT NULL,
  `translation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `example` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `exampletranslation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `status` text CHARACTER SET utf8 NOT NULL,
  `soundFile` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `translationrate` int(11) NOT NULL,
  `searchedWord` varchar(90) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `converted` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `dicusers`
--

CREATE TABLE `dicusers` (
  `id` int(11) NOT NULL,
  `userid` varchar(200) CHARACTER SET latin1 NOT NULL,
  `username` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invitesent` int(11) DEFAULT '0',
  `latitude` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `step` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT 'userIsTranslating',
  `adminApproveStatus` varchar(300) CHARACTER SET latin1 DEFAULT NULL,
  `role` enum('USER','TRANSLATOR','EDITOR','ADMIN') CHARACTER SET latin1 NOT NULL,
  `keyboard` enum('DEACTIVATED','ACTIVATED','DISABLE','') CHARACTER SET latin1 NOT NULL,
  `trust` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `dicusers_bots`
--

CREATE TABLE `dicusers_bots` (
  `id` int(11) NOT NULL,
  `botID` enum('@TranslateSwedish_bot','@TranslateSwedish3_bot','') COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `userID` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `dicusers_contribution`
--

CREATE TABLE `dicusers_contribution` (
  `id` int(11) NOT NULL,
  `artikel` varchar(3) COLLATE utf8_persian_ci NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `type` varchar(20) COLLATE utf8_persian_ci NOT NULL,
  `plural` varchar(40) COLLATE utf8_persian_ci NOT NULL,
  `problemType` varchar(100) COLLATE utf8_persian_ci NOT NULL DEFAULT 'AddNewWord',
  `translation` text COLLATE utf8_persian_ci NOT NULL,
  `soundFile` varchar(50) COLLATE utf8_persian_ci DEFAULT NULL,
  `relatedWord` text COLLATE utf8_persian_ci,
  `rate` int(11) NOT NULL DEFAULT '0',
  `wordLanguage` varchar(100) COLLATE utf8_persian_ci NOT NULL,
  `userid` varchar(500) COLLATE utf8_persian_ci NOT NULL,
  `status` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `message_id` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `adminOpinion` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `askedByUser` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `insertedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

-- --------------------------------------------------------

--
-- Table structure for table `dic_ads`
--

CREATE TABLE `dic_ads` (
  `id` int(11) NOT NULL,
  `userid` varchar(50) NOT NULL,
  `adsid` varchar(50) NOT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dic_ads_pool`
--

CREATE TABLE `dic_ads_pool` (
  `id` int(11) NOT NULL,
  `adsID` varchar(25) NOT NULL,
  `msgID` varchar(15) NOT NULL,
  `chatID` varchar(15) NOT NULL,
  `botID` enum('@TranslateGerman_bot','@TranslateGerman2_bot','@TranslateGerman3_bot','@Test_TranslateGerman_bot') NOT NULL,
  `adsSent` int(11) NOT NULL DEFAULT '0',
  `adsLimit` int(11) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '0',
  `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dic_conjunction`
--

CREATE TABLE `dic_conjunction` (
  `id` int(11) NOT NULL,
  `verb` char(200) COLLATE utf8_bin NOT NULL,
  `form` char(100) CHARACTER SET utf8 NOT NULL,
  `person` char(10) COLLATE utf8_bin NOT NULL,
  `infinitive` varchar(300) COLLATE utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- --------------------------------------------------------

--
-- Table structure for table `dic_fasv`
--

CREATE TABLE `dic_fasv` (
  `id` int(11) NOT NULL,
  `word` varchar(68) DEFAULT NULL,
  `translation` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dic_phrases`
--

CREATE TABLE `dic_phrases` (
  `id` int(11) NOT NULL,
  `word` varchar(40) NOT NULL,
  `sentence` text NOT NULL,
  `translation` text NOT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dic_suggested_users`
--

CREATE TABLE `dic_suggested_users` (
  `id` int(11) NOT NULL,
  `userid` varchar(200) NOT NULL,
  `suggestedid` varchar(200) NOT NULL,
  `Datum` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `dic_svfa`
--

CREATE TABLE `dic_svfa` (
  `id` int(11) NOT NULL,
  `word` varchar(69) DEFAULT NULL,
  `translation` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `dic_word_suggestion`
--

CREATE TABLE `dic_word_suggestion` (
  `id` int(11) NOT NULL DEFAULT '0',
  `searchedWord` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Stand-in structure for view `usersactivity_till_now`
-- (See below for the actual view)
--
CREATE TABLE `usersactivity_till_now` (
`userid` varchar(200)
,`COUNT( userid )` bigint(21)
);

-- --------------------------------------------------------

--
-- Table structure for table `user_activities`
--

CREATE TABLE `user_activities` (
  `id` int(11) NOT NULL,
  `userid` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `intent_id` int(11) NOT NULL DEFAULT '-1',
  `searchedWord` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `translated` tinyint(1) NOT NULL,
  `trdate` datetime NOT NULL,
  `todayAsked` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

-- --------------------------------------------------------

--
-- Structure for view `usersactivity_till_now`
--

-- CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `usersactivity_till_now`  AS  select `user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `COUNT( userid )` from `user_activities` group by `user_activities`.`userid` order by count(`user_activities`.`userid`) desc ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bots`
--
ALTER TABLE `bots`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dictionary`
--
ALTER TABLE `dictionary`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dictionary_merged`
--
ALTER TABLE `dictionary_merged`
  ADD PRIMARY KEY (`id`),
  ADD KEY `searchedWord` (`searchedWord`);

--
-- Indexes for table `dicusers`
--
ALTER TABLE `dicusers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `userid` (`userid`);

--
-- Indexes for table `dicusers_bots`
--
ALTER TABLE `dicusers_bots`
  ADD PRIMARY KEY (`id`),
  ADD KEY `botID` (`botID`),
  ADD KEY `userID` (`userID`);

--
-- Indexes for table `dicusers_contribution`
--
ALTER TABLE `dicusers_contribution`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_ads`
--
ALTER TABLE `dic_ads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `userid` (`userid`),
  ADD KEY `userid_2` (`userid`),
  ADD KEY `adsid` (`adsid`),
  ADD KEY `timeStamp` (`timeStamp`);

--
-- Indexes for table `dic_ads_pool`
--
ALTER TABLE `dic_ads_pool`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_conjunction`
--
ALTER TABLE `dic_conjunction`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_fasv`
--
ALTER TABLE `dic_fasv`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_phrases`
--
ALTER TABLE `dic_phrases`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_suggested_users`
--
ALTER TABLE `dic_suggested_users`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dic_svfa`
--
ALTER TABLE `dic_svfa`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `user_activities`
--
ALTER TABLE `user_activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `userid` (`userid`),
  ADD KEY `searchedWord` (`searchedWord`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bots`
--
ALTER TABLE `bots`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dictionary`
--
ALTER TABLE `dictionary`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dictionary_merged`
--
ALTER TABLE `dictionary_merged`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=260716;
--
-- AUTO_INCREMENT for table `dicusers`
--
ALTER TABLE `dicusers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3007;
--
-- AUTO_INCREMENT for table `dicusers_bots`
--
ALTER TABLE `dicusers_bots`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3016;
--
-- AUTO_INCREMENT for table `dicusers_contribution`
--
ALTER TABLE `dicusers_contribution`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_ads`
--
ALTER TABLE `dic_ads`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_ads_pool`
--
ALTER TABLE `dic_ads_pool`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_conjunction`
--
ALTER TABLE `dic_conjunction`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_fasv`
--
ALTER TABLE `dic_fasv`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38029;
--
-- AUTO_INCREMENT for table `dic_phrases`
--
ALTER TABLE `dic_phrases`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_suggested_users`
--
ALTER TABLE `dic_suggested_users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `dic_svfa`
--
ALTER TABLE `dic_svfa`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32739;
--
-- AUTO_INCREMENT for table `user_activities`
--
ALTER TABLE `user_activities`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10559;
