
CREATE TABLE IF NOT EXISTS `formBuilder_elements` (
  `id` int(11) NOT NULL auto_increment,
  `defaultName` varchar(255) default NULL,
  `formName` varchar(255) NOT NULL,
  `type` enum('text','email','select','multiselect','textarea','checkbox','radio','multicheckbox','captcha','imagebrowser') NOT NULL,
  `maxChars` int(11) default NULL,
  `isDisplay` tinyint(1) NOT NULL default '1',
  `isRequired` tinyint(1) NOT NULL default '0',
  `order` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `formBuilder_elements_i18n` (
  `id` int(11) NOT NULL,
  `fieldName` varchar(250) NOT NULL,
  `tooltip` varchar(250) NOT NULL,
  `locale` varchar(5) NOT NULL default 'en_US',
  KEY `label` (`fieldName`,`locale`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `formBuilder_element_options` (
  `id` int(11) NOT NULL auto_increment,
  `elementId` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `elementId` (`elementId`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `formBuilder_element_options_i18n` (
  `id` int(11) NOT NULL,
  `optionValue` varchar(250) NOT NULL,
  `locale` varchar(5) NOT NULL default 'en_US',
  KEY `value` (`optionValue`,`locale`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `formBuilder_formData` (
  `id` int(11) NOT NULL auto_increment,
  `formName` varchar(255) NOT NULL,
  `elementName` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `id` (`id`,`formName`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `formBuilder_formData_i18n` (
  `id` int(11) NOT NULL,
  `elementValue` varchar(255) NOT NULL,
  `locale` varchar(5) NOT NULL default 'en_US',
  PRIMARY KEY  (`id`),
  KEY `id` (`id`,`locale`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;