
-- 
-- Table structure for table `answers`
-- 

CREATE TABLE `answers` (
  `form_id` bigint(20) unsigned NOT NULL default '0',
  `submission_id` bigint(20) unsigned NOT NULL default '0',
  `question_id` smallint(6) unsigned NOT NULL default '0',
  `value` text NOT NULL,
  KEY `form_id_index` (`form_id`),
  KEY `submission_id` (`submission_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `block_list`
-- 

CREATE TABLE `block_list` (
  `email` varchar(250) NOT NULL,
  PRIMARY KEY  (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `forms`
-- 

CREATE TABLE `forms` (
  `id` bigint(20) unsigned NOT NULL default '0',
  `username` varchar(31) default NULL,
  `title` varchar(255) default NULL,
  `height` smallint(5) unsigned default NULL,
  `status` varchar(10) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `listings`
-- 

CREATE TABLE `listings` (
  `id` bigint(20) unsigned NOT NULL,
  `form_id` bigint(20) unsigned NOT NULL,
  `title` varchar(80) collate utf8_unicode_ci NOT NULL,
  `fields` varchar(200) collate utf8_unicode_ci NOT NULL,
  `list_type` varchar(10) collate utf8_unicode_ci NOT NULL,
  `status` varchar(10) collate utf8_unicode_ci NOT NULL default 'ENABLED',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `monthly_usage`
-- 

CREATE TABLE `monthly_usage` (
  `username` varchar(31) collate utf8_unicode_ci NOT NULL,
  `submissions` int(10) unsigned NOT NULL,
  `ssl_submissions` int(10) unsigned NOT NULL,
  `payments` int(10) unsigned NOT NULL,
  `uploads` int(10) unsigned NOT NULL,
  `tickets` smallint(5) unsigned NOT NULL,
  `warned` varchar(10) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `payment_log`
-- 

CREATE TABLE `payment_log` (
  `date_time` datetime NOT NULL,
  `activity` varchar(80) collate utf8_unicode_ci default NULL,
  `submission_id` bigint(11) NOT NULL,
  `payment_id` bigint(11) NOT NULL,
  `total` float NOT NULL,
  `curr` varchar(10) collate utf8_unicode_ci NOT NULL,
  `note` text collate utf8_unicode_ci,
  `ip` varchar(20) collate utf8_unicode_ci NOT NULL,
  KEY `submission_id` (`submission_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `payment_products`
-- 

CREATE TABLE `payment_products` (
  `payment_id` bigint(11) unsigned NOT NULL,
  `product_id` bigint(11) unsigned NOT NULL,
  KEY `payment_id` (`payment_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `payments`
-- 

CREATE TABLE `payments` (
  `id` bigint(11) unsigned NOT NULL,
  `payer_name` varchar(80) collate utf8_unicode_ci default NULL,
  `payer_email` varchar(80) collate utf8_unicode_ci default NULL,
  `total` float NOT NULL,
  `curr` varchar(10) collate utf8_unicode_ci NOT NULL,
  `submission_id` bigint(11) unsigned NOT NULL,
  `status` varchar(80) collate utf8_unicode_ci default NULL,
  `date_time` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `products`
-- 

CREATE TABLE `products` (
  `form_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(11) unsigned NOT NULL,
  `name` varchar(80) collate utf8_unicode_ci default NULL,
  `price` float default NULL,
  `subs_type` varchar(10) collate utf8_unicode_ci default NULL,
  `subs_duration` int(11) default NULL,
  `setup_fee` int(11) default NULL,
  `currency` varchar(10) collate utf8_unicode_ci default NULL,
  `trial_type` varchar(10) collate utf8_unicode_ci default NULL,
  `trial_duration` int(11) default NULL,
  `type` varchar(20) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

-- 
-- Table structure for table `question_properties`
-- 

CREATE TABLE `question_properties` (
  `form_id` bigint(20) unsigned NOT NULL default '0',
  `question_id` smallint(6) unsigned NOT NULL default '0',
  `prop` varchar(255) NOT NULL default '',
  `value` text,
  PRIMARY KEY  (`form_id`,`question_id`,`prop`),
  UNIQUE KEY `form_id` (`form_id`,`question_id`,`prop`),
  KEY `prop` (`prop`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `questions`
-- 

CREATE TABLE `questions` (
  `form_id` bigint(20) unsigned NOT NULL default '0',
  `id` smallint(6) unsigned NOT NULL default '0',
  `order` smallint(6) NOT NULL default '0',
  `type` varchar(63) NOT NULL default '',
  PRIMARY KEY  (`form_id`,`id`),
  KEY `form_id` (`form_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `submissions`
-- 

CREATE TABLE `submissions` (
  `id` bigint(20) NOT NULL default '0',
  `form_id` bigint(20) NOT NULL,
  `ip` varchar(21) NOT NULL default '',
  `date_time` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` varchar(21) default NULL,
  PRIMARY KEY  (`id`),
  KEY `form_id` (`form_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

-- 
-- Table structure for table `users`
-- 

CREATE TABLE `users` (
  `username` varchar(31) NOT NULL default '',
  `password` varchar(31) default NULL,
  `email` varchar(127) default NULL,
  `name` varchar(63) default NULL,
  `url` varchar(255) default NULL,
  `account_type` varchar(31) default NULL,
  `friends` text,
  `is_html` varchar(5) NOT NULL,
  `creation_date` date NOT NULL,
  `last_seen` date NOT NULL,
  `time_zone` tinyint(4) NOT NULL,
  PRIMARY KEY  (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


