PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE `directus_migrations` (`version` varchar(255) not null, `name` varchar(255) not null, `timestamp` datetime default CURRENT_TIMESTAMP, primary key (`version`));
INSERT INTO directus_migrations VALUES('20201028A','Remove Collection Foreign Keys','2023-06-09 14:51:48');
INSERT INTO directus_migrations VALUES('20201029A','Remove System Relations','2023-06-09 14:51:48');
INSERT INTO directus_migrations VALUES('20201029B','Remove System Collections','2023-06-09 14:51:48');
INSERT INTO directus_migrations VALUES('20201029C','Remove System Fields','2023-06-09 14:51:48');
INSERT INTO directus_migrations VALUES('20201105A','Add Cascade System Relations','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20201105B','Change Webhook URL Type','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210225A','Add Relations Sort Field','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210304A','Remove Locked Fields','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210312A','Webhooks Collections Text','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210331A','Add Refresh Interval','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210415A','Make Filesize Nullable','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210416A','Add Collections Accountability','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210422A','Remove Files Interface','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210506A','Rename Interfaces','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210510A','Restructure Relations','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210518A','Add Foreign Key Constraints','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210519A','Add System Fk Triggers','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210521A','Add Collections Icon Color','2023-06-09 14:51:49');
INSERT INTO directus_migrations VALUES('20210525A','Add Insights','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210608A','Add Deep Clone Config','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210626A','Change Filesize Bigint','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210716A','Add Conditions to Fields','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210721A','Add Default Folder','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210802A','Replace Groups','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210803A','Add Required to Fields','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210805A','Update Groups','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210805B','Change Image Metadata Structure','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210811A','Add Geometry Config','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210831A','Remove Limit Column','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210903A','Add Auth Provider','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210907A','Webhooks Collections Not Null','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210910A','Move Module Setup','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210920A','Webhooks URL Not Null','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210924A','Add Collection Organization','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210927A','Replace Fields Group','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210927B','Replace M2M Interface','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20210929A','Rename Login Action','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211007A','Update Presets','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211009A','Add Auth Data','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211016A','Add Webhook Headers','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211103A','Set Unique to User Token','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211103B','Update Special Geometry','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211104A','Remove Collections Listing','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211118A','Add Notifications','2023-06-09 14:51:50');
INSERT INTO directus_migrations VALUES('20211211A','Add Shares','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20211230A','Add Project Descriptor','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220303A','Remove Default Project Color','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220308A','Add Bookmark Icon and Color','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220314A','Add Translation Strings','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220322A','Rename Field Typecast Flags','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220323A','Add Field Validation','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220325A','Fix Typecast Flags','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220325B','Add Default Language','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220402A','Remove Default Value Panel Icon','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220429A','Add Flows','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220429B','Add Color to Insights Icon','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220429C','Drop Non Null From IP of Activity','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220429D','Drop Non Null From Sender of Notifications','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220614A','Rename Hook Trigger to Event','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220801A','Update Notifications Timestamp Column','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220802A','Add Custom Aspect Ratios','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20220826A','Add Origin to Accountability','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20230401A','Update Material Icons','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20230525A','Add Preview Settings','2023-06-09 14:51:51');
INSERT INTO directus_migrations VALUES('20230526A','Migrate Translation Strings','2023-06-09 14:51:51');
CREATE TABLE IF NOT EXISTS "directus_folders" (`id` char(36) NOT NULL, `name` varchar(255) NOT NULL, `parent` char(36), PRIMARY KEY (`id`), FOREIGN KEY (`parent`) REFERENCES `directus_folders` (`id`));
CREATE TABLE IF NOT EXISTS "directus_relations" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `many_collection` varchar(64) NOT NULL, `many_field` varchar(64) NOT NULL, `one_collection` varchar(64), `one_field` varchar(64), `one_collection_field` varchar(64), `one_allowed_collections` text, `junction_field` varchar(64), `sort_field` varchar(64), `one_deselect_action` varchar(255) NOT NULL DEFAULT 'nullify');
CREATE TABLE IF NOT EXISTS "directus_revisions" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `activity` integer NOT NULL, `collection` varchar(64) NOT NULL, `item` varchar(255) NOT NULL, `data` json, `delta` json, `parent` integer, FOREIGN KEY (`parent`) REFERENCES `directus_revisions` (`id`), FOREIGN KEY (`activity`) REFERENCES `directus_activity` (`id`) ON DELETE CASCADE);
CREATE TABLE `directus_dashboards` (`id` char(36) not null, `name` varchar(255) not null, `icon` varchar(30) not null default 'dashboard', `note` text, `date_created` datetime default CURRENT_TIMESTAMP, `user_created` char(36), `color` varchar(255) null, foreign key(`user_created`) references `directus_users`(`id`) on delete SET NULL, primary key (`id`));
CREATE TABLE IF NOT EXISTS "directus_files" (`id` char(36) NOT NULL, `storage` varchar(255) NOT NULL, `filename_disk` varchar(255), `filename_download` varchar(255) NOT NULL, `title` varchar(255), `type` varchar(255), `folder` char(36), `uploaded_by` char(36), `uploaded_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified_by` char(36), `modified_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `charset` varchar(50), `filesize` bigint DEFAULT null, `width` integer, `height` integer, `duration` integer, `embed` varchar(200), `description` text, `location` text, `tags` text, `metadata` json, PRIMARY KEY (`id`), FOREIGN KEY (`uploaded_by`) REFERENCES `directus_users` (`id`), FOREIGN KEY (`modified_by`) REFERENCES `directus_users` (`id`), FOREIGN KEY (`folder`) REFERENCES `directus_folders` (`id`) ON DELETE SET NULL);
CREATE TABLE IF NOT EXISTS "directus_permissions" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `role` char(36), `collection` varchar(64) NOT NULL, `action` varchar(10) NOT NULL, `permissions` json, `validation` json, `presets` json, `fields` text, FOREIGN KEY (`role`) REFERENCES `directus_roles` (`id`) ON DELETE CASCADE);
CREATE TABLE IF NOT EXISTS "directus_webhooks" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `name` varchar(255) NOT NULL, `method` varchar(10) NOT NULL DEFAULT 'POST', `url` varchar(255) NOT NULL, `status` varchar(10) NOT NULL DEFAULT 'active', `data` boolean NOT NULL DEFAULT '1', `actions` varchar(100) NOT NULL, `collections` varchar(255) NOT NULL, `headers` json);
CREATE TABLE IF NOT EXISTS "directus_collections" (`collection` varchar(64) NOT NULL, `icon` varchar(30), `note` text, `display_template` varchar(255), `hidden` boolean NOT NULL DEFAULT '0', `singleton` boolean NOT NULL DEFAULT '0', `translations` json, `archive_field` varchar(64), `archive_app_filter` boolean NOT NULL DEFAULT '1', `archive_value` varchar(255), `unarchive_value` varchar(255), `sort_field` varchar(64), `accountability` varchar(255) DEFAULT 'all', `color` varchar(255) NULL, `item_duplication_fields` json NULL, `sort` integer, `group` varchar(64), `collapse` varchar(255) NOT NULL DEFAULT 'open', `preview_url` varchar(255) null, PRIMARY KEY (`collection`), FOREIGN KEY (`group`) REFERENCES `directus_collections` (`collection`));
CREATE TABLE IF NOT EXISTS "directus_fields" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `collection` varchar(64) NOT NULL, `field` varchar(64) NOT NULL, `special` varchar(64), `interface` varchar(64), `options` json, `display` varchar(64), `display_options` json, `readonly` boolean NOT NULL DEFAULT '0', `hidden` boolean NOT NULL DEFAULT '0', `sort` integer, `width` varchar(30) DEFAULT 'full', `translations` json, `note` text, `conditions` json, `required` boolean DEFAULT '0', `group` varchar(64), `validation` json, `validation_message` text);
CREATE TABLE IF NOT EXISTS "directus_roles" (`id` char(36) NOT NULL, `name` varchar(100) NOT NULL, `icon` varchar(30) NOT NULL DEFAULT 'supervised_user_circle', `description` text, `ip_access` text, `enforce_tfa` boolean NOT NULL DEFAULT '0', `admin_access` boolean NOT NULL DEFAULT '0', `app_access` boolean NOT NULL DEFAULT '1', PRIMARY KEY (`id`));
INSERT INTO directus_roles VALUES('067808bd-7c13-40be-8c11-9ba654b79465','Administrator','verified','$t:admin_description',NULL,0,1,1);
CREATE TABLE `directus_shares` (`id` char(36) not null, `name` varchar(255), `collection` varchar(64), `item` varchar(255), `role` char(36), `password` varchar(255), `user_created` char(36), `date_created` datetime default CURRENT_TIMESTAMP, `date_start` datetime null default null, `date_end` datetime null default null, `times_used` integer default '0', `max_uses` integer, foreign key(`collection`) references `directus_collections`(`collection`) on delete CASCADE, foreign key(`role`) references `directus_roles`(`id`) on delete CASCADE, foreign key(`user_created`) references `directus_users`(`id`) on delete SET NULL, primary key (`id`));
CREATE TABLE IF NOT EXISTS "directus_sessions" (`token` varchar(64) NOT NULL, `user` char(36), `expires` datetime NOT NULL, `ip` varchar(255), `user_agent` varchar(255), `share` char(36), `origin` varchar(255) null, PRIMARY KEY (`token`), FOREIGN KEY (`user`) REFERENCES `directus_users` (`id`) ON DELETE CASCADE, FOREIGN KEY (`share`) REFERENCES `directus_shares` (`id`) ON DELETE CASCADE);
CREATE TABLE IF NOT EXISTS "directus_users" (`id` char(36) NOT NULL, `first_name` varchar(50), `last_name` varchar(50), `email` varchar(128), `password` varchar(255), `location` varchar(255), `title` varchar(50), `description` text, `tags` json, `avatar` char(36), `language` varchar(255) DEFAULT null, `theme` varchar(20) DEFAULT 'auto', `tfa_secret` varchar(255), `status` varchar(16) NOT NULL DEFAULT 'active', `role` char(36), `token` varchar(255), `last_access` datetime, `last_page` varchar(255), `provider` varchar(128) NOT NULL DEFAULT 'default', `external_identifier` varchar(255), `auth_data` json, `email_notifications` boolean DEFAULT '1', PRIMARY KEY (`id`), FOREIGN KEY (`role`) REFERENCES `directus_roles` (`id`) ON DELETE SET NULL);
INSERT INTO directus_users VALUES('f9df4549-e9e6-4b67-a0bd-7e4aa657bff6',NULL,NULL,'okram@civokram.com','$argon2id$v=19$m=65536,t=3,p=4$rk0X9HITfk7OIfvEjOrbew$Q4wUp0tjs42ocHPwVPzI3dksy+JKWzQzO5a3gqOwDg8',NULL,NULL,NULL,NULL,NULL,NULL,'auto',NULL,'active','067808bd-7c13-40be-8c11-9ba654b79465',NULL,NULL,NULL,'default',NULL,NULL,1);
CREATE TABLE IF NOT EXISTS "directus_panels" (`id` char(36) NOT NULL, `dashboard` char(36) NOT NULL, `name` varchar(255), `icon` varchar(30) DEFAULT null, `color` varchar(10), `show_header` boolean NOT NULL DEFAULT '0', `note` text, `type` varchar(255) NOT NULL, `position_x` integer NOT NULL, `position_y` integer NOT NULL, `width` integer NOT NULL, `height` integer NOT NULL, `options` json, `date_created` datetime DEFAULT CURRENT_TIMESTAMP, `user_created` char(36), FOREIGN KEY (`dashboard`) REFERENCES `directus_dashboards` (`id`) ON DELETE CASCADE, FOREIGN KEY (`user_created`) REFERENCES `directus_users` (`id`) ON DELETE SET NULL, PRIMARY KEY (`id`));
CREATE TABLE `directus_flows` (`id` char(36) not null, `name` varchar(255) not null, `icon` varchar(30), `color` varchar(255) null, `description` text, `status` varchar(255) not null default 'active', `trigger` varchar(255), `accountability` varchar(255) default 'all', `options` json, `operation` char(36), `date_created` datetime default CURRENT_TIMESTAMP, `user_created` char(36), foreign key(`user_created`) references `directus_users`(`id`) on delete SET NULL, primary key (`id`));
CREATE TABLE `directus_operations` (`id` char(36) not null, `name` varchar(255), `key` varchar(255) not null, `type` varchar(255) not null, `position_x` integer not null, `position_y` integer not null, `options` json, `resolve` char(36), `reject` char(36), `flow` char(36) not null, `date_created` datetime default CURRENT_TIMESTAMP, `user_created` char(36), foreign key(`resolve`) references `directus_operations`(`id`), foreign key(`reject`) references `directus_operations`(`id`), foreign key(`flow`) references `directus_flows`(`id`) on delete CASCADE, foreign key(`user_created`) references `directus_users`(`id`) on delete SET NULL, primary key (`id`));
CREATE TABLE IF NOT EXISTS "directus_activity" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `action` varchar(45) NOT NULL, `user` char(36), `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `ip` varchar(50), `user_agent` varchar(255), `collection` varchar(64) NOT NULL, `item` varchar(255) NOT NULL, `comment` text, `origin` varchar(255) null);
CREATE TABLE IF NOT EXISTS "directus_notifications" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` datetime DEFAULT CURRENT_TIMESTAMP, `status` varchar(255) DEFAULT 'inbox', `recipient` char(36) NOT NULL, `sender` char(36), `subject` varchar(255) NOT NULL, `message` text, `collection` varchar(64), `item` varchar(255), FOREIGN KEY (`recipient`) REFERENCES `directus_users` (`id`) ON DELETE CASCADE, FOREIGN KEY (`sender`) REFERENCES `directus_users` (`id`));
CREATE TABLE IF NOT EXISTS "directus_presets" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `bookmark` varchar(255), `user` char(36), `role` char(36), `collection` varchar(64), `search` varchar(100), `layout` varchar(100) DEFAULT 'tabular', `layout_query` json, `layout_options` json, `refresh_interval` integer, `filter` json, `icon` varchar(30) DEFAULT 'bookmark', `color` varchar(255) NULL, FOREIGN KEY (`user`) REFERENCES `directus_users` (`id`) ON DELETE CASCADE, FOREIGN KEY (`role`) REFERENCES `directus_roles` (`id`) ON DELETE CASCADE);
CREATE TABLE `directus_translations` (`id` char(36) not null, `language` varchar(255) not null, `key` varchar(255) not null, `value` text not null, primary key (`id`));
CREATE TABLE IF NOT EXISTS "directus_settings" (`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `project_name` varchar(100) NOT NULL DEFAULT 'Directus', `project_url` varchar(255), `project_color` varchar(50) DEFAULT null, `project_logo` char(36), `public_foreground` char(36), `public_background` char(36), `public_note` text, `auth_login_attempts` integer DEFAULT '25', `auth_password_policy` varchar(100), `storage_asset_transform` varchar(7) DEFAULT 'all', `storage_asset_presets` json, `custom_css` text, `storage_default_folder` char(36), `basemaps` json, `mapbox_key` varchar(255), `module_bar` json, `project_descriptor` varchar(100) NULL, `default_language` varchar(255) NOT NULL DEFAULT 'en-US', `custom_aspect_ratios` json, FOREIGN KEY (`project_logo`) REFERENCES `directus_files` (`id`), FOREIGN KEY (`public_foreground`) REFERENCES `directus_files` (`id`), FOREIGN KEY (`public_background`) REFERENCES `directus_files` (`id`), CONSTRAINT `directus_settings_storage_default_folder_foreign` FOREIGN KEY (`storage_default_folder`) REFERENCES `directus_folders` (`id`) ON DELETE SET NULL);
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('directus_relations',0);
INSERT INTO sqlite_sequence VALUES('directus_revisions',0);
INSERT INTO sqlite_sequence VALUES('directus_permissions',0);
INSERT INTO sqlite_sequence VALUES('directus_webhooks',0);
INSERT INTO sqlite_sequence VALUES('directus_fields',0);
INSERT INTO sqlite_sequence VALUES('directus_activity',0);
INSERT INTO sqlite_sequence VALUES('directus_notifications',0);
INSERT INTO sqlite_sequence VALUES('directus_presets',0);
INSERT INTO sqlite_sequence VALUES('directus_settings',0);
CREATE UNIQUE INDEX `directus_users_external_identifier_unique` on `directus_users` (`external_identifier`);
CREATE UNIQUE INDEX `directus_users_email_unique` on `directus_users` (`email`);
CREATE UNIQUE INDEX `directus_users_token_unique` on `directus_users` (`token`);
CREATE UNIQUE INDEX `directus_flows_operation_unique` on `directus_flows` (`operation`);
CREATE UNIQUE INDEX `directus_operations_resolve_unique` on `directus_operations` (`resolve`);
CREATE UNIQUE INDEX `directus_operations_reject_unique` on `directus_operations` (`reject`);
COMMIT;
