-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 05, 2018 at 11:17 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24

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

--
-- Database: `leopoly`
--

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

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `subscription_type_id` int(3) NOT NULL,
  `payer_id` varchar(300) NOT NULL,
  `payment_id` varchar(300) NOT NULL,
  `payment_token` varchar(300) NOT NULL,
  `transaction_id` varchar(50) NOT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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

--
-- Table structure for table `subscription`
--

CREATE TABLE `subscription` (
  `id` int(11) NOT NULL,
  `payment_type_id` int(5) NOT NULL,
  `user_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `expiration_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `subscription_type`
--

CREATE TABLE `subscription_type` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `price` float NOT NULL,
  `expiration_date` varchar(10) NOT NULL,
  `invite_limit` int(5) NOT NULL,
  `export_limit` varchar(20) NOT NULL,
  `import_limit` varchar(20) NOT NULL,
  `edit_page_available` tinyint(1) NOT NULL,
  `is_subscription` tinyint(1) NOT NULL,
  `is_free` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `subscription_type`
--

INSERT INTO `subscription_type` (`id`, `name`, `price`, `expiration_date`, `invite_limit`, `export_limit`, `import_limit`, `edit_page_available`, `is_subscription`, `is_free`) VALUES
(1, 'free', 0, '', 0, '0', '0', 0, 0, 0),
(2, 'registered', 0, '', 0, '0', 'unlimited', 1, 0, 0),
(3, 'registered_7', 0, '1 week', 0, '6', 'unlimited', 1, 0, 1),
(4, 'personal', 4.99, '1 month', 0, '100', 'unlimited', 1, 1, 0),
(5, 'personal_365', 29.99, '1 year', 0, '100', 'unlimited', 1, 1, 0),
(6, 'group', 124.75, '1 month', 50, '100', 'unlimited', 1, 1, 0),
(7, 'group_365', 749.75, '1 year', 50, '100', 'unlimited', 1, 1, 0),
(8, 'shool_365', 1499, '1 year', 200, 'unlimited', 'unlimited', 1, 1, 0),
(9, 'site_licence', 0, '1 month', 1000, 'unlimited', 'unlimited', 1, 1, 0),
(10, 'site_licence_365', 0, '1 year', 1000, 'unlimited', 'unlimited', 1, 1, 0),
(11, 'cancelled', 0, '', 0, '0', '0', 0, 0, 0);

--
-- Indexes for dumped tables
--

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `payment`
--
ALTER TABLE `payment`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `subscription`
--
ALTER TABLE `subscription`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subscription_type`
--
ALTER TABLE `subscription_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;