/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.21-log : Database - directus-live
*********************************************************************
*/





/*Table structure for table `directus_activity` */


CREATE TABLE `directus_activity` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `action` varchar(45) NOT NULL,
  `action_by` int(11) unsigned NOT NULL DEFAULT '0',
  `action_on` datetime NOT NULL,
  `ip` varchar(50) NOT NULL,
  `user_agent` varchar(255) NOT NULL,
  `collection` varchar(64) NOT NULL,
  `item` varchar(255) NOT NULL,
  `edited_on` datetime DEFAULT NULL,
  `comment` text CHARACTER SET utf8mb4,
  `comment_deleted_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `directus_activity` */

insert  into `directus_activity`(`id`,`action`,`action_by`,`action_on`,`ip`,`user_agent`,`collection`,`item`,`edited_on`,`comment`,`comment_deleted_on`) values (1,'authenticate',1,'2019-06-22 07:28:21','::1','Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36','directus_users','1',NULL,NULL,NULL);

/*Table structure for table `directus_activity_seen` */


CREATE TABLE `directus_activity_seen` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `activity` int(11) unsigned NOT NULL,
  `user` int(11) unsigned NOT NULL DEFAULT '0',
  `seen_on` datetime DEFAULT NULL,
  `archived` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_activity_seen` */

/*Table structure for table `directus_collection_presets` */


CREATE TABLE `directus_collection_presets` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `user` int(11) unsigned DEFAULT NULL,
  `role` int(11) unsigned DEFAULT NULL,
  `collection` varchar(64) NOT NULL,
  `search_query` varchar(100) DEFAULT NULL,
  `filters` text,
  `view_type` varchar(100) NOT NULL DEFAULT 'tabular',
  `view_query` text,
  `view_options` text,
  `translation` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_collection_title` (`user`,`collection`,`title`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

/*Data for the table `directus_collection_presets` */

insert  into `directus_collection_presets`(`id`,`title`,`user`,`role`,`collection`,`search_query`,`filters`,`view_type`,`view_query`,`view_options`,`translation`) values (1,NULL,NULL,NULL,'directus_activity',NULL,NULL,'timeline','{\"timeline\":{\"sort\":\"-action_on\"}}','{\"timeline\":{\"date\":\"action_on\",\"title\":\"{{ action_by.first_name }} {{ action_by.last_name }} ({{ action }})\",\"content\":\"action_by\",\"color\":\"action\"}}',NULL),(2,NULL,NULL,NULL,'directus_files',NULL,NULL,'cards',NULL,'{\"cards\":{\"title\":\"title\",\"subtitle\":\"type\",\"content\":\"description\",\"src\":\"data\"}}',NULL),(3,NULL,NULL,NULL,'directus_users',NULL,NULL,'cards',NULL,'{\"cards\":{\"title\":\"first_name\",\"subtitle\":\"last_name\",\"content\":\"title\",\"src\":\"avatar\",\"icon\":\"person\"}}',NULL);

/*Table structure for table `directus_collections` */


CREATE TABLE `directus_collections` (
  `collection` varchar(64) NOT NULL,
  `managed` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `single` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `icon` varchar(30) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `translation` text,
  PRIMARY KEY (`collection`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_collections` */

/*Table structure for table `directus_fields` */


CREATE TABLE `directus_fields` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `collection` varchar(64) NOT NULL,
  `field` varchar(64) NOT NULL,
  `type` varchar(64) NOT NULL,
  `interface` varchar(64) DEFAULT NULL,
  `options` text,
  `locked` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `validation` varchar(255) DEFAULT NULL,
  `required` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `readonly` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `hidden_detail` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `hidden_browse` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `sort` int(11) unsigned DEFAULT NULL,
  `width` varchar(30) DEFAULT NULL,
  `group` int(11) unsigned DEFAULT NULL,
  `note` varchar(1024) DEFAULT NULL,
  `translation` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_collection_field` (`collection`,`field`)
) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8;



/*Table structure for table `directus_files` */


CREATE TABLE `directus_files` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `storage` varchar(50) NOT NULL DEFAULT 'local',
  `filename` varchar(255) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `uploaded_by` int(11) unsigned NOT NULL,
  `uploaded_on` datetime NOT NULL,
  `charset` varchar(50) DEFAULT NULL,
  `filesize` int(11) unsigned NOT NULL DEFAULT '0',
  `width` int(11) unsigned DEFAULT NULL,
  `height` int(11) unsigned DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  `embed` varchar(200) DEFAULT NULL,
  `folder` int(11) unsigned DEFAULT NULL,
  `description` text,
  `location` varchar(200) DEFAULT NULL,
  `tags` varchar(255) DEFAULT NULL,
  `checksum` varchar(32) DEFAULT NULL,
  `metadata` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_files` */

/*Table structure for table `directus_folders` */


CREATE TABLE `directus_folders` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) CHARACTER SET utf8mb4 NOT NULL,
  `parent_folder` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_name_parent_folder` (`name`,`parent_folder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_folders` */

/*Table structure for table `directus_migrations` */


CREATE TABLE `directus_migrations` (
  `version` bigint(20) NOT NULL,
  `migration_name` varchar(100) DEFAULT NULL,
  `start_time` timestamp NULL DEFAULT NULL,
  `end_time` timestamp NULL DEFAULT NULL,
  `breakpoint` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_migrations` */

insert  into `directus_migrations`(`version`,`migration_name`,`start_time`,`end_time`,`breakpoint`) values (20180220023138,'CreateActivityTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023144,'CreateActivitySeenTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023152,'CreateCollectionsPresetsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023157,'CreateCollectionsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023202,'CreateFieldsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023208,'CreateFilesTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023213,'CreateFoldersTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023217,'CreateRolesTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023226,'CreatePermissionsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023232,'CreateRelationsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023238,'CreateRevisionsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023243,'CreateSettingsTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180220023248,'CreateUsersTable','2019-06-22 07:28:11','2019-06-22 07:28:11',0),(20180426173310,'CreateUserRoles','2019-06-22 07:28:11','2019-06-22 07:28:12',0),(20181022175715,'Upgrade070003','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181102153600,'TimezoneChoices','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181105165224,'Upgrade070006','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181122195602,'LocaleInterface','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181123171520,'RemoveScope','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181210204720,'AddTrustedProxiesSettingField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181222023800,'AddProjectUrlSettingField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20181227042755,'IncreaseUsersLastPageLength','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190104155309,'AddUsersEmailValidation','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190111193724,'AddAppUrlSettingField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190111212736,'AddMissingSettingsField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190118181424,'AddRolesUsersField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190130215921,'AddFilesChecksumField','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190318173400,'AddNavOverride','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190412122400,'SetPasswordTypeToHash','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190412123000,'UseFileInterface','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190412145800,'SetO2MOptionsRoles','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190415125300,'SetWidth','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190419154400,'SettingsFields','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190419161200,'CollectionNotes','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190419173000,'MiscRequiredFields','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190422131600,'UseJson','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190426156200,'SetNullableValueFieldSettingsTable','2019-06-22 07:28:32','2019-06-22 07:28:32',0),(20190520094300,'UseTimeline','2019-06-22 07:28:32','2019-06-22 07:28:32',0);

/*Table structure for table `directus_permissions` */


CREATE TABLE `directus_permissions` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `collection` varchar(64) NOT NULL,
  `role` int(11) unsigned NOT NULL,
  `status` varchar(64) DEFAULT NULL,
  `create` varchar(16) DEFAULT 'none',
  `read` varchar(16) DEFAULT 'none',
  `update` varchar(16) DEFAULT 'none',
  `delete` varchar(16) DEFAULT 'none',
  `comment` varchar(8) DEFAULT 'none',
  `explain` varchar(8) DEFAULT 'none',
  `read_field_blacklist` varchar(1000) DEFAULT NULL,
  `write_field_blacklist` varchar(1000) DEFAULT NULL,
  `status_blacklist` varchar(1000) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_permissions` */

/*Table structure for table `directus_relations` */


CREATE TABLE `directus_relations` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `collection_many` varchar(64) NOT NULL,
  `field_many` varchar(45) NOT NULL,
  `collection_one` varchar(64) DEFAULT NULL,
  `field_one` varchar(64) DEFAULT NULL,
  `junction_field` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

/*Data for the table `directus_relations` */

insert  into `directus_relations`(`id`,`collection_many`,`field_many`,`collection_one`,`field_one`,`junction_field`) values (1,'directus_activity','action_by','directus_users',NULL,NULL),(2,'directus_activity_seen','user','directus_users',NULL,NULL),(3,'directus_activity_seen','activity','directus_activity',NULL,NULL),(4,'directus_collections_presets','user','directus_users',NULL,NULL),(5,'directus_collections_presets','group','directus_groups',NULL,NULL),(6,'directus_files','uploaded_by','directus_users',NULL,NULL),(7,'directus_files','folder','directus_folders',NULL,NULL),(8,'directus_folders','parent_folder','directus_folders',NULL,NULL),(9,'directus_permissions','group','directus_groups',NULL,NULL),(10,'directus_revisions','activity','directus_activity',NULL,NULL),(11,'directus_user_roles','user','directus_users','roles','role'),(12,'directus_user_roles','role','directus_roles','users','user'),(13,'directus_users','avatar','directus_files',NULL,NULL),(14,'directus_fields','collection','directus_collections','fields',NULL);

/*Table structure for table `directus_revisions` */


CREATE TABLE `directus_revisions` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `activity` int(11) unsigned NOT NULL,
  `collection` varchar(64) NOT NULL,
  `item` varchar(255) NOT NULL,
  `data` longtext NOT NULL,
  `delta` longtext,
  `parent_collection` varchar(64) DEFAULT NULL,
  `parent_item` varchar(255) DEFAULT NULL,
  `parent_changed` tinyint(1) unsigned DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `directus_revisions` */

/*Table structure for table `directus_roles` */


CREATE TABLE `directus_roles` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` varchar(500) DEFAULT NULL,
  `ip_whitelist` text,
  `nav_blacklist` text,
  `external_id` varchar(255) DEFAULT NULL,
  `nav_override` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_group_name` (`name`),
  UNIQUE KEY `idx_roles_external_id` (`external_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

/*Data for the table `directus_roles` */

insert  into `directus_roles`(`id`,`name`,`description`,`ip_whitelist`,`nav_blacklist`,`external_id`,`nav_override`) values (1,'Administrator','Admins have access to all managed data within the system by default',NULL,NULL,NULL,NULL),(2,'Public','This sets the data that is publicly available through the API without a token',NULL,NULL,NULL,NULL);

/*Table structure for table `directus_settings` */


CREATE TABLE `directus_settings` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(64) NOT NULL,
  `value` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_key` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

/*Data for the table `directus_settings` */

insert  into `directus_settings`(`id`,`key`,`value`) values (1,'logo',''),(2,'color','darkest-gray'),(3,'default_limit','200'),(4,'sort_null_last','1'),(5,'auto_sign_out','60'),(6,'youtube_api_key',''),(7,'trusted_proxies',''),(8,'thumbnail_dimensions','200x200'),(9,'thumbnail_quality_tags','{\"poor\": 25, \"good\": 50, \"better\":  75, \"best\": 100}'),(10,'thumbnail_actions','{\"contain\":{\"options\":{\"resizeCanvas\":false,\"position\":\"center\",\"resizeRelative\":false,\"canvasBackground\":\"ccc\"}},\"crop\":{\"options\":{\"position\":\"center\"}}}'),(11,'thumbnail_cache_ttl','86400'),(12,'thumbnail_not_found_location',''),(13,'project_name','Directus'),(14,'app_url',''),(15,'project_url','');

/*Table structure for table `directus_user_roles` */


CREATE TABLE `directus_user_roles` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user` int(11) unsigned DEFAULT NULL,
  `role` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_role` (`user`,`role`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `directus_user_roles` */

insert  into `directus_user_roles`(`id`,`user`,`role`) values (1,1,1);

