CREATE TABLE IF NOT EXISTS `zd_dataview` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `source` mediumint(8) NOT NULL,
  `name` varchar(155) NOT NULL,
  `acl` enum('open','private') NOT NULL default 'open',
  `whitelist` text NOT NULL,
  `sql` text NOT NULL,
  `fields` mediumtext NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
