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

--
-- Table structure for table `periods`
--

DROP TABLE IF EXISTS `periods`;
CREATE TABLE IF NOT EXISTS `periods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `plan` enum('trial','pro','lite','community') NOT NULL DEFAULT 'pro',
  `date_from` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_till` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `max_days` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
  `is_floating` tinyint(1) NOT NULL DEFAULT '0',
  `floating_slots` tinyint(3) UNSIGNED NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `user_id_in_periods_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3988 DEFAULT CHARSET=utf8;

--
-- RELATIONS FOR TABLE `periods`:
--   `user_id`
--       `users` -> `id`
--
