-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 04, 2018 at 03:22 PM
-- Server version: 5.7.20-0ubuntu0.17.04.1
-- PHP Version: 7.0.22-0ubuntu0.17.04.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!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 */;

--
-- Database: `prewikka`
--

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

--
-- Table structure for table `Prewikka_Module_Changed`
--

CREATE TABLE `Prewikka_Module_Changed` (
  `time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `Prewikka_Module_Changed` (`time`) VALUES
(current_timestamp);

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

--
-- Table structure for table `Prewikka_Module_Registry`
--

CREATE TABLE `Prewikka_Module_Registry` (
  `module` varchar(255) NOT NULL,
  `enabled` tinyint(4) DEFAULT '1',
  `branch` varchar(16) DEFAULT NULL,
  `version` varchar(16) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `Prewikka_Session`
--

CREATE TABLE `Prewikka_Session` (
  `sessionid` varchar(48) NOT NULL,
  `userid` varchar(32) NOT NULL,
  `login` varchar(255) NOT NULL,
  `time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `Prewikka_User_Configuration`
--

CREATE TABLE `Prewikka_User_Configuration` (
  `userid` varchar(255) NOT NULL,
  `config` text NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `Prewikka_Crontab`
--

CREATE TABLE `Prewikka_Crontab` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `userid` varchar(32) NULL,
  `schedule` varchar(32) NULL,
  `ext_type` varchar(255) NULL,
  `ext_id` integer NULL,
  `base` datetime NOT NULL,
  `enabled` tinyint default 1,
  `runcnt` integer default 0,
  `error` text NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `Prewikka_History_Query`
--

CREATE TABLE `Prewikka_History_Query` (
  `userid` varchar(32) NOT NULL,
  `formid` varchar(255) NOT NULL,
  `query` text NOT NULL,
  `query_hash` varchar(32) NOT NULL,
  `timestamp` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `Prewikka_Module_Registry`
--
ALTER TABLE `Prewikka_Module_Registry`
  ADD PRIMARY KEY (`module`);

--
-- Indexes for table `Prewikka_Session`
--
ALTER TABLE `Prewikka_Session`
  ADD PRIMARY KEY (`sessionid`);

--
-- Indexes for table `Prewikka_User_Configuration`
--
ALTER TABLE `Prewikka_User_Configuration`
  ADD PRIMARY KEY (`userid`);

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

--
-- Indexes for table `Prewikka_History_Query`
--
ALTER TABLE `Prewikka_History_Query`
  ADD PRIMARY KEY (`userid`, `formid`, `query_hash`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `Prewikka_Crontab`
--
ALTER TABLE `Prewikka_Crontab`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
/*!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 */;
