YANZ UPLOAD ANJG

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `projectsend290` -- -- -------------------------------------------------------- -- -- Table structure for table `activity_log` -- CREATE TABLE `activity_log` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `actor_id` bigint unsigned DEFAULT NULL, `actor_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `actor_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `origin` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ui', `api_token_id` bigint unsigned DEFAULT NULL, `api_token_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `subject_id` bigint unsigned DEFAULT NULL, `subject_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `context` json DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `activity_log_actor_id_foreign` (`actor_id`), KEY `activity_log_subject_type_subject_id_index` (`subject_type`,`subject_id`), KEY `activity_log_action_index` (`action`), KEY `activity_log_created_at_index` (`created_at`), KEY `activity_log_actor_type_index` (`actor_type`), KEY `activity_log_origin_index` (`origin`), KEY `activity_log_action_actor_created_index` (`action`,`actor_type`,`created_at`), KEY `activity_log_action_created_index` (`action`,`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `api_request_logs` -- CREATE TABLE `api_request_logs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `api_token_id` bigint unsigned DEFAULT NULL, `api_token_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_id` bigint unsigned DEFAULT NULL, `method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `route` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `status` smallint unsigned NOT NULL, `duration_ms` int unsigned NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `api_request_logs_user_id_foreign` (`user_id`), KEY `api_request_logs_api_token_id_created_at_index` (`api_token_id`,`created_at`), KEY `api_request_logs_route_created_at_index` (`route`,`created_at`), KEY `api_request_logs_created_at_index` (`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `branding_settings` -- CREATE TABLE `branding_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `logo_original_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `logo_crop` json DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `watermark_enabled` tinyint(1) NOT NULL DEFAULT '0', `watermark_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `watermark_position` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bottom-right', `watermark_size` tinyint unsigned NOT NULL DEFAULT '30', `watermark_opacity` tinyint unsigned NOT NULL DEFAULT '60', `hide_attribution` tinyint(1) NOT NULL DEFAULT '0', `show_site_name` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `cache` -- CREATE TABLE `cache` ( `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `expiration` int NOT NULL, PRIMARY KEY (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `cache_locks` -- CREATE TABLE `cache_locks` ( `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `expiration` int NOT NULL, PRIMARY KEY (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `captcha_providers` -- CREATE TABLE `captcha_providers` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `site_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `secret_key` text COLLATE utf8mb4_unicode_ci, `score_threshold` decimal(3,2) DEFAULT '0.50', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `captcha_providers_provider_unique` (`provider`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'gray', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `categories_name_unique` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `category_file` -- CREATE TABLE `category_file` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `category_id` bigint unsigned NOT NULL, `file_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `category_file_category_id_file_id_unique` (`category_id`,`file_id`), KEY `category_file_file_id_foreign` (`file_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `client_custom_fields` -- CREATE TABLE `client_custom_fields` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `options` json DEFAULT NULL, `required` tinyint(1) NOT NULL DEFAULT '0', `client_editability` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'hidden', `client_contexts` json DEFAULT NULL, `sort_order` int unsigned NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `client_custom_fields_name_unique` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `client_custom_field_values` -- CREATE TABLE `client_custom_field_values` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `client_custom_field_id` bigint unsigned NOT NULL, `user_id` bigint unsigned NOT NULL, `value` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `client_custom_field_values_client_custom_field_id_user_id_unique` (`client_custom_field_id`,`user_id`), KEY `client_custom_field_values_user_id_foreign` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `custom_assets` -- CREATE TABLE `custom_assets` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `language` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `content` text COLLATE utf8mb4_unicode_ci NOT NULL, `surfaces` json NOT NULL, `position` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '0', `created_by` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `dashboard_widget_preferences` -- CREATE TABLE `dashboard_widget_preferences` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint unsigned NOT NULL, `widget_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '1', `column_index` tinyint unsigned NOT NULL DEFAULT '0', `position` int unsigned NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `dashboard_widget_preferences_user_id_widget_key_unique` (`user_id`,`widget_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `email_templates` -- CREATE TABLE `email_templates` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `slot` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email_templates_slot_unique` (`slot`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `external_storage_settings` -- CREATE TABLE `external_storage_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `active` tinyint(1) NOT NULL DEFAULT '0', `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 's3', `use_instance_role` tinyint(1) NOT NULL DEFAULT '0', `key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `secret` text COLLATE utf8mb4_unicode_ci, `key_file` text COLLATE utf8mb4_unicode_ci, `bucket` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `region` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `endpoint` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `use_path_style` tinyint(1) NOT NULL DEFAULT '0', `root` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `files` -- CREATE TABLE `files` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `uploaded_by` bigint unsigned DEFAULT NULL, `folder_id` bigint unsigned DEFAULT NULL, `previous_file_id` bigint unsigned DEFAULT NULL, `version_root_id` bigint unsigned DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `public` tinyint(1) NOT NULL DEFAULT '0', `commentable` tinyint(1) NOT NULL DEFAULT '0', `expires_at` timestamp NULL DEFAULT NULL, `download_limit` int unsigned DEFAULT NULL, `download_limit_scope` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'total', `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `disk` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'files', `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `size` bigint unsigned NOT NULL, `checksum` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `scan_status` varchar(24) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'not_scanned', `scan_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `scanned_at` timestamp NULL DEFAULT NULL, `scan_engine` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `scan_attempts` int unsigned NOT NULL DEFAULT '0', `released_by` bigint unsigned DEFAULT NULL, `released_at` timestamp NULL DEFAULT NULL, `scan_was_available` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `files_slug_unique` (`slug`), UNIQUE KEY `files_previous_file_id_unique` (`previous_file_id`), KEY `files_uploaded_by_foreign` (`uploaded_by`), KEY `files_folder_id_foreign` (`folder_id`), KEY `files_updated_at_id_index` (`updated_at`,`id`), KEY `files_version_root_id_index` (`version_root_id`), KEY `files_download_limit_index` (`download_limit`), KEY `files_released_by_foreign` (`released_by`), KEY `files_scan_status_index` (`scan_status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `file_assignments` -- CREATE TABLE `file_assignments` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `file_id` bigint unsigned NOT NULL, `assignable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `assignable_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `file_assignments_file_id_assignable_type_assignable_id_unique` (`file_id`,`assignable_type`,`assignable_id`), KEY `file_assignments_assignable_type_assignable_id_index` (`assignable_type`,`assignable_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `file_comments` -- CREATE TABLE `file_comments` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `file_id` bigint unsigned NOT NULL, `author_id` bigint unsigned DEFAULT NULL, `client_context_id` bigint unsigned DEFAULT NULL, `guest_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `visibility` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `body` text COLLATE utf8mb4_unicode_ci NOT NULL, `approved_at` timestamp NULL DEFAULT NULL, `edited_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `file_comments_author_id_foreign` (`author_id`), KEY `file_comments_client_context_id_foreign` (`client_context_id`), KEY `file_comments_file_id_visibility_index` (`file_id`,`visibility`), KEY `file_comments_file_id_client_context_id_index` (`file_id`,`client_context_id`), KEY `file_comments_approved_at_index` (`approved_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `folders` -- CREATE TABLE `folders` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `parent_id` bigint unsigned DEFAULT NULL, `created_by` bigint unsigned DEFAULT NULL, `home_for_user_id` bigint unsigned DEFAULT NULL, `public` tinyint(1) NOT NULL DEFAULT '0', `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `allow_client_uploads` tinyint(1) NOT NULL DEFAULT '0', `path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '/', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `folders_slug_unique` (`slug`), UNIQUE KEY `folders_home_for_user_id_unique` (`home_for_user_id`), KEY `folders_parent_id_foreign` (`parent_id`), KEY `folders_created_by_foreign` (`created_by`), KEY `folders_path_index` (`path`), KEY `folders_updated_at_id_index` (`updated_at`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `folder_assignments` -- CREATE TABLE `folder_assignments` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `folder_id` bigint unsigned NOT NULL, `assignable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `assignable_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `folder_assignment_unique` (`folder_id`,`assignable_type`,`assignable_id`), KEY `folder_assignments_assignable_type_assignable_id_index` (`assignable_type`,`assignable_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `groups` -- CREATE TABLE `groups` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, `public` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `groups_slug_unique` (`slug`), KEY `groups_updated_at_id_index` (`updated_at`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `group_members` -- CREATE TABLE `group_members` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `group_id` bigint unsigned NOT NULL, `user_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `group_members_group_id_user_id_unique` (`group_id`,`user_id`), KEY `group_members_user_id_foreign` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `invitations` -- CREATE TABLE `invitations` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `resends` int unsigned NOT NULL DEFAULT '0', `storage_quota_mb` int unsigned NOT NULL DEFAULT '0', `group_id` bigint unsigned DEFAULT NULL, `invited_by_id` bigint unsigned DEFAULT NULL, `expires_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invitations_token_unique` (`token`), KEY `invitations_group_id_foreign` (`group_id`), KEY `invitations_invited_by_id_foreign` (`invited_by_id`), KEY `invitations_email_status_index` (`email`,`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `jobs` -- CREATE TABLE `jobs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `attempts` tinyint unsigned NOT NULL, `reserved_at` int unsigned DEFAULT NULL, `available_at` int unsigned NOT NULL, `created_at` int unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `job_batches` -- CREATE TABLE `job_batches` ( `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `total_jobs` int NOT NULL, `pending_jobs` int NOT NULL, `failed_jobs` int NOT NULL, `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `options` mediumtext COLLATE utf8mb4_unicode_ci, `cancelled_at` int DEFAULT NULL, `created_at` int NOT NULL, `finished_at` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ldap_settings` -- CREATE TABLE `ldap_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `active` tinyint(1) NOT NULL DEFAULT '0', `host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `port` smallint unsigned NOT NULL DEFAULT '389', `encryption` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tls', `ca_cert_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `bind_dn` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `bind_password` text COLLATE utf8mb4_unicode_ci, `base_dn` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_filter` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email_attribute` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'mail', `name_attribute` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cn', `auto_provision` tinyint(1) NOT NULL DEFAULT '0', `auto_approve` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `username_attribute` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `mail_oauth_connections` -- CREATE TABLE `mail_oauth_connections` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `client_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `client_secret` text COLLATE utf8mb4_unicode_ci, `tenant_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `account_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `access_token` text COLLATE utf8mb4_unicode_ci, `refresh_token` text COLLATE utf8mb4_unicode_ci, `token_expires_at` timestamp NULL DEFAULT NULL, `last_refreshed_at` timestamp NULL DEFAULT NULL, `last_error` text COLLATE utf8mb4_unicode_ci, `broken_notified_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mail_oauth_connections_provider_unique` (`provider`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `mail_provider_settings` -- CREATE TABLE `mail_provider_settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'custom', `host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `port` smallint unsigned DEFAULT NULL, `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` text COLLATE utf8mb4_unicode_ci, `encryption` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tls', `from_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `from_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `mcp_authorization_codes` -- CREATE TABLE `mcp_authorization_codes` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `code_hash` char(64) COLLATE utf8mb4_unicode_ci NOT NULL, `mcp_client_id` bigint unsigned NOT NULL, `user_id` bigint unsigned NOT NULL, `scopes` json NOT NULL, `code_challenge` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, `redirect_uri` text COLLATE utf8mb4_unicode_ci NOT NULL, `resource` text COLLATE utf8mb4_unicode_ci NOT NULL, `expires_at` timestamp NOT NULL, `used_at` timestamp NULL DEFAULT NULL, `issued_token_id` bigint unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `mcp_connection_id` bigint unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mcp_authorization_codes_code_hash_unique` (`code_hash`), KEY `mcp_authorization_codes_mcp_client_id_foreign` (`mcp_client_id`), KEY `mcp_authorization_codes_user_id_foreign` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `mcp_clients` -- CREATE TABLE `mcp_clients` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `client_id` text COLLATE utf8mb4_unicode_ci NOT NULL, `client_id_hash` char(64) COLLATE utf8mb4_unicode_ci NOT NULL, `kind` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `client_uri` text COLLATE utf8mb4_unicode_ci, `logo_uri` text COLLATE utf8mb4_unicode_ci, `redirect_uris` json NOT NULL, `metadata` json DEFAULT NULL, `metadata_fetched_at` timestamp NULL DEFAULT NULL, `metadata_expires_at` timestamp NULL DEFAULT NULL, `fingerprint` char(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mcp_clients_client_id_hash_unique` (`client_id_hash`), KEY `mcp_clients_fingerprint_index` (`fingerprint`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `mcp_connections` -- CREATE TABLE `mcp_connections` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `mcp_client_id` bigint unsigned NOT NULL, `user_id` bigint unsigned NOT NULL, `scopes` json NOT NULL, `refresh_token_hash` char(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `previous_refresh_token_hash` char(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `family` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `access_token_id` bigint unsigned DEFAULT NULL, `last_used_at` timestamp NULL DEFAULT NULL, `refresh_expires_at` timestamp NOT NULL, `revoked_at` timestamp NULL DEFAULT NULL, `revoked_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mcp_connections_refresh_token_hash_unique` (`refresh_token_hash`), KEY `mcp_connections_mcp_client_id_foreign` (`mcp_client_id`), KEY `mcp_connections_user_id_foreign` (`user_id`), KEY `mcp_connections_previous_refresh_token_hash_index` (`previous_refresh_token_hash`), KEY `mcp_connections_family_index` (`family`), KEY `mcp_connections_access_token_id_index` (`access_token_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `membership_requests` -- CREATE TABLE `membership_requests` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `group_id` bigint unsigned NOT NULL, `user_id` bigint unsigned NOT NULL, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `denied_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `membership_requests_group_id_user_id_unique` (`group_id`,`user_id`), KEY `membership_requests_user_id_foreign` (`user_id`), KEY `membership_requests_status_index` (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=97 ; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` VALUES (1, '0001_01_01_000000_create_users_table', 1), (2, '0001_01_01_000001_create_cache_table', 1), (3, '0001_01_01_000002_create_jobs_table', 1), (4, '2026_07_22_200000_add_type_to_users_table', 1), (5, '2026_07_22_210000_create_settings_table', 1), (6, '2026_07_23_090000_add_two_factor_columns_to_users_table', 1), (7, '2026_07_23_120000_create_activity_log_table', 1), (8, '2026_07_24_090000_create_roles_tables', 1), (9, '2026_07_24_150000_add_active_to_users_table', 1), (10, '2026_07_25_090000_add_actor_type_to_activity_log_table', 1), (11, '2026_07_25_120000_add_account_requested_to_users_table', 1), (12, '2026_07_25_150000_add_soft_deletes_to_users_table', 1), (13, '2026_07_25_170000_add_erase_after_to_users_table', 1), (14, '2026_07_26_090000_create_groups_tables', 1), (15, '2026_07_26_150000_add_status_to_membership_requests_table', 1), (16, '2026_07_27_090000_create_files_tables', 1), (17, '2026_07_27_150000_create_upload_sessions_table', 1), (18, '2026_07_28_090000_create_folders_tables', 1), (19, '2026_07_28_120000_add_client_scoped_to_roles_table', 1), (20, '2026_07_28_130000_create_staff_client_assignments_table', 1), (21, '2026_07_28_140000_create_categories_tables', 1), (22, '2026_07_29_090000_add_ip_address_to_activity_log_table', 1), (23, '2026_07_30_090000_create_share_links_table', 1), (24, '2026_07_31_000000_create_custom_assets_table', 1), (25, '2026_07_31_090000_add_color_to_categories_table', 1), (26, '2026_08_01_090000_add_locale_to_users_table', 1), (27, '2026_08_02_090000_create_mail_provider_settings_table', 1), (28, '2026_08_02_090000_remove_unblock_ip_permission_rows', 1), (29, '2026_08_03_090000_create_email_templates_table', 1), (30, '2026_08_04_090000_create_zip_downloads_table', 1), (31, '2026_08_05_090000_create_client_custom_fields_tables', 1), (32, '2026_08_06_090000_add_storage_quota_mb_to_users_table', 1), (33, '2026_08_07_090000_add_slug_to_groups_table', 1), (34, '2026_08_07_090000_create_branding_settings_table', 1), (35, '2026_08_07_090100_add_public_to_files_table', 1), (36, '2026_08_07_120000_add_watermark_to_branding_settings', 1), (37, '2026_08_08_090000_add_slug_to_files_table', 1), (38, '2026_08_10_090000_add_disk_to_files_table', 1), (39, '2026_08_10_090000_create_notifications_table', 1), (40, '2026_08_10_090100_create_external_storage_settings_table', 1), (41, '2026_08_10_090100_create_notification_preferences_table', 1), (42, '2026_08_10_090200_create_dashboard_widget_preferences_table', 1), (43, '2026_08_10_090300_add_dashboard_columns_to_users_table', 1), (44, '2026_08_11_090000_add_description_to_upload_sessions_table', 1), (45, '2026_08_11_090000_add_expires_at_to_files_table', 1), (46, '2026_08_12_090000_add_client_editability_to_client_custom_fields_table', 1), (47, '2026_08_13_090000_add_hide_attribution_to_branding_settings', 1), (48, '2026_08_13_090000_remove_edit_self_account_permission_rows', 1), (49, '2026_08_14_090000_remove_test_email_and_change_template_permission_rows', 1), (50, '2026_08_15_090000_grant_create_own_folders_to_client_role', 1), (51, '2026_08_16_090000_add_public_to_folders_table', 1), (52, '2026_08_17_090000_add_folder_id_to_upload_sessions_table', 1), (53, '2026_08_18_090000_create_scheduled_task_runs_table', 1), (54, '2026_08_19_090000_create_personal_access_tokens_table', 1), (55, '2026_08_20_090000_add_polling_index_to_files_table', 1), (56, '2026_08_21_090000_add_polling_indexes_to_users_and_groups', 1), (57, '2026_08_22_090000_add_origin_to_activity_log', 1), (58, '2026_08_23_090000_create_api_request_logs_table', 1), (59, '2026_08_23_090000_create_mail_oauth_connections_table', 1), (60, '2026_08_24_090000_create_file_comments_table', 1), (61, '2026_08_24_090100_add_commentable_to_files_table', 1), (62, '2026_08_25_090000_create_pending_notifications_table', 1), (63, '2026_08_26_090000_add_file_versioning_to_files_table', 1), (64, '2026_08_26_090100_add_previous_file_id_to_upload_sessions_table', 1), (65, '2026_08_27_090000_add_ldap_to_users_table', 1), (66, '2026_08_27_090100_create_ldap_settings_table', 1), (67, '2026_08_28_090000_add_auto_approve_to_ldap_settings_table', 1), (68, '2026_08_29_090000_create_social_login_providers_table', 1), (69, '2026_08_29_090100_create_social_accounts_table', 1), (70, '2026_08_30_090000_add_timezone_to_users_table', 1), (71, '2026_08_31_090000_add_download_limit_to_files_table', 1), (72, '2026_08_31_090100_add_delivery_to_zip_downloads_table', 1), (73, '2026_09_01_090000_create_captcha_providers_table', 1), (74, '2026_09_02_090000_vacate_slugs_held_by_deleted_rows', 1), (75, '2026_09_03_090000_add_provider_to_external_storage_settings_table', 1), (76, '2026_09_04_090000_add_contained_files_to_zip_downloads_table', 1), (77, '2026_09_05_090000_add_started_at_to_zip_downloads_table', 1), (78, '2026_09_06_090000_relabel_bcrypt_hashes_the_hasher_will_not_read', 1), (79, '2026_09_07_090000_add_broken_notified_at_to_mail_oauth_connections_table', 1), (80, '2026_09_08_090000_add_reporting_indexes_to_activity_log', 1), (81, '2026_09_10_090000_add_use_instance_role_to_external_storage_settings_table', 1), (82, '2026_09_11_090000_add_staged_bytes_to_upload_sessions_table', 1), (83, '2026_09_12_090000_create_invitations_table', 1), (84, '2026_09_12_170000_add_resends_to_invitations_table', 1), (85, '2026_09_13_090000_add_expires_at_to_users_table', 1), (86, '2026_09_13_100000_add_start_page_to_roles_and_users', 1), (87, '2026_09_16_090000_add_scan_columns_to_files_table', 1), (88, '2026_09_17_090000_add_home_for_user_id_to_folders_table', 1), (89, '2026_09_22_000000_create_mcp_oauth_tables', 1), (90, '2026_09_25_100000_add_show_site_name_to_branding_settings', 1), (91, '2026_10_02_090000_add_polling_index_to_folders_table', 1), (92, '2026_10_03_090000_add_logo_crop_to_branding_settings', 1), (93, '2026_10_05_090000_add_username_attribute_to_ldap_settings', 1), (94, '2026_10_23_090000_add_skip_two_factor_to_social_login_providers', 1), (95, '2026_11_07_090000_add_connection_to_mcp_authorization_codes', 1), (96, '2026_11_09_090000_add_public_scope_to_zip_downloads_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `notifications` -- CREATE TABLE `notifications` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint unsigned NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `subject_id` bigint unsigned DEFAULT NULL, `data` json DEFAULT NULL, `read_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `notifications_subject_type_subject_id_index` (`subject_type`,`subject_id`), KEY `notifications_user_id_read_at_index` (`user_id`,`read_at`), KEY `notifications_user_id_created_at_index` (`user_id`,`created_at`), KEY `notifications_type_index` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `notification_preferences` -- CREATE TABLE `notification_preferences` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint unsigned NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_enabled` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `notification_preferences_user_id_type_unique` (`user_id`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `password_reset_tokens` -- CREATE TABLE `password_reset_tokens` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `pending_notifications` -- CREATE TABLE `pending_notifications` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint unsigned NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `subject_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `context` json DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `pending_notifications_user_id_type_index` (`user_id`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `personal_access_tokens` -- CREATE TABLE `personal_access_tokens` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `tokenable_id` bigint unsigned NOT NULL, `name` text COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `abilities` text COLLATE utf8mb4_unicode_ci, `last_used_at` timestamp NULL DEFAULT NULL, `expires_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `personal_access_tokens_token_unique` (`token`), KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`), KEY `personal_access_tokens_expires_at_index` (`expires_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `is_system` tinyint(1) NOT NULL DEFAULT '0', `is_administrator` tinyint(1) NOT NULL DEFAULT '0', `client_scoped` tinyint(1) NOT NULL DEFAULT '0', `start_page` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `roles_name_unique` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=5 ; -- -- Dumping data for table `roles` -- INSERT INTO `roles` VALUES (1, 'System Administrator', 1, 1, 0, NULL, '[[regtime]]', '[[regtime]]'), (2, 'Account Manager', 1, 0, 0, NULL, '[[regtime]]', '[[regtime]]'), (3, 'Client Manager', 1, 0, 1, NULL, '[[regtime]]', '[[regtime]]'), (4, 'Client', 1, 0, 0, NULL, '[[regtime]]', '[[regtime]]'); -- -------------------------------------------------------- -- -- Table structure for table `role_permission` -- CREATE TABLE `role_permission` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `role_id` bigint unsigned NOT NULL, `permission` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `role_permission_role_id_permission_unique` (`role_id`,`permission`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=39 ; -- -- Dumping data for table `role_permission` -- INSERT INTO `role_permission` VALUES (17, 2, 'approve_account_requests'), (21, 2, 'approve_groups_memberships_requests'), (10, 2, 'create_categories'), (13, 2, 'create_clients'), (18, 2, 'create_groups'), (12, 2, 'delete_categories'), (15, 2, 'delete_clients'), (4, 2, 'delete_files'), (20, 2, 'delete_groups'), (5, 2, 'delete_others_files'), (11, 2, 'edit_categories'), (14, 2, 'edit_clients'), (2, 2, 'edit_files'), (19, 2, 'edit_groups'), (3, 2, 'edit_others_files'), (8, 2, 'import_orphans'), (16, 2, 'manage_custom_fields'), (9, 2, 'moderate_comments'), (6, 2, 'set_file_expiration_date'), (1, 2, 'upload'), (7, 2, 'upload_public'), (22, 2, 'view_actions_log'), (24, 2, 'view_news'), (23, 2, 'view_statistics'), (30, 3, 'create_categories'), (33, 3, 'create_own_folders'), (32, 3, 'delete_categories'), (27, 3, 'delete_files'), (31, 3, 'edit_categories'), (26, 3, 'edit_files'), (28, 3, 'set_file_expiration_date'), (25, 3, 'upload'), (29, 3, 'upload_public'), (34, 3, 'view_actions_log'), (36, 3, 'view_news'), (35, 3, 'view_statistics'), (38, 4, 'create_own_folders'), (37, 4, 'upload'); -- -------------------------------------------------------- -- -- Table structure for table `scheduled_task_runs` -- CREATE TABLE `scheduled_task_runs` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `command` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `message` text COLLATE utf8mb4_unicode_ci, `duration_ms` int unsigned DEFAULT NULL, `ran_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `scheduled_task_runs_command_unique` (`command`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `sessions` -- CREATE TABLE `sessions` ( `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint unsigned DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_agent` text COLLATE utf8mb4_unicode_ci, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `last_activity` int NOT NULL, PRIMARY KEY (`id`), KEY `sessions_user_id_index` (`user_id`), KEY `sessions_last_activity_index` (`last_activity`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `settings` -- CREATE TABLE `settings` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` json DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `settings_key_unique` (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `settings` -- INSERT INTO `settings` VALUES (1, 'site_name', '"[[site_name]]"', '[[regtime]]', '[[regtime]]'), (2, 'admin_notification_emails', '["[[admin_email]]"]', '[[regtime]]', '[[regtime]]'), (3, 'getting_started_pending', 'true', '[[regtime]]', '[[regtime]]'); -- -------------------------------------------------------- -- -- Table structure for table `share_links` -- CREATE TABLE `share_links` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `shareable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `shareable_id` bigint unsigned NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `created_by` bigint unsigned DEFAULT NULL, `expires_at` timestamp NULL DEFAULT NULL, `max_downloads` int unsigned DEFAULT NULL, `downloads_count` int unsigned NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `share_links_token_unique` (`token`), KEY `share_links_shareable_type_shareable_id_index` (`shareable_type`,`shareable_id`), KEY `share_links_created_by_foreign` (`created_by`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `social_accounts` -- CREATE TABLE `social_accounts` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint unsigned NOT NULL, `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `provider_user_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `social_accounts_provider_provider_user_id_unique` (`provider`,`provider_user_id`), UNIQUE KEY `social_accounts_user_id_provider_unique` (`user_id`,`provider`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `social_login_providers` -- CREATE TABLE `social_login_providers` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `enabled` tinyint(1) NOT NULL DEFAULT '0', `client_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `client_secret` text COLLATE utf8mb4_unicode_ci, `issuer_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tenant_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `require_verified_email` tinyint(1) NOT NULL DEFAULT '1', `allowed_domains` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `auto_provision` tinyint(1) NOT NULL DEFAULT '0', `auto_approve` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `skip_two_factor` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `social_login_providers_provider_unique` (`provider`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `staff_client_assignments` -- CREATE TABLE `staff_client_assignments` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `staff_id` bigint unsigned NOT NULL, `client_id` bigint unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `staff_client_unique` (`staff_id`,`client_id`), KEY `staff_client_assignments_client_id_foreign` (`client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `upload_sessions` -- CREATE TABLE `upload_sessions` ( `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint unsigned NOT NULL, `folder_id` bigint unsigned DEFAULT NULL, `previous_file_id` bigint unsigned DEFAULT NULL, `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `size` bigint unsigned NOT NULL, `staged_bytes` bigint unsigned NOT NULL DEFAULT '0', `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `upload_sessions_user_id_foreign` (`user_id`), KEY `upload_sessions_folder_id_foreign` (`folder_id`), KEY `upload_sessions_previous_file_id_foreign` (`previous_file_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'staff', `auth_source` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'local', `ldap_dn` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ldap_synced_at` timestamp NULL DEFAULT NULL, `role_id` bigint unsigned DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', `account_requested` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `locale` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `timezone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `start_page` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dashboard_columns` tinyint unsigned DEFAULT NULL, `storage_quota_mb` int unsigned NOT NULL DEFAULT '0', `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `two_factor_secret` text COLLATE utf8mb4_unicode_ci, `two_factor_recovery_codes` text COLLATE utf8mb4_unicode_ci, `two_factor_confirmed_at` timestamp NULL DEFAULT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `erase_after` timestamp NULL DEFAULT NULL, `expires_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), KEY `users_type_index` (`type`), KEY `users_role_id_foreign` (`role_id`), KEY `users_updated_at_id_index` (`updated_at`,`id`), KEY `users_expires_at_index` (`expires_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `users` -- INSERT INTO `users` VALUES (1, 'staff', 'local', NULL, NULL, 1, 1, 0, '[[admin_username]]', '[[admin_email]]', NULL, NULL, NULL, NULL, 0, '[[regtime]]', '[[admin_pass]]', NULL, NULL, NULL, NULL, '[[regtime]]', '[[regtime]]', NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `zip_downloads` -- CREATE TABLE `zip_downloads` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `requested_by` bigint unsigned DEFAULT NULL, `public_scope_type` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `public_scope_id` bigint unsigned DEFAULT NULL, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending', `path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `file_ids` json DEFAULT NULL, `folder_ids` json DEFAULT NULL, `contained_file_ids` json DEFAULT NULL, `file_count` int unsigned NOT NULL DEFAULT '0', `total_size` bigint unsigned DEFAULT NULL, `delivered_at` timestamp NULL DEFAULT NULL, `started_at` timestamp NULL DEFAULT NULL, `skipped_files` json DEFAULT NULL, `error` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `zip_downloads_requested_by_foreign` (`requested_by`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -- Constraints for dumped tables -- -- -- Constraints for table `activity_log` -- ALTER TABLE `activity_log` ADD CONSTRAINT `activity_log_actor_id_foreign` FOREIGN KEY (`actor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL; -- -- Constraints for table `api_request_logs` -- ALTER TABLE `api_request_logs` ADD CONSTRAINT `api_request_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL; -- -- Constraints for table `category_file` -- ALTER TABLE `category_file` ADD CONSTRAINT `category_file_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `category_file_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE; -- -- Constraints for table `client_custom_field_values` -- ALTER TABLE `client_custom_field_values` ADD CONSTRAINT `client_custom_field_values_client_custom_field_id_foreign` FOREIGN KEY (`client_custom_field_id`) REFERENCES `client_custom_fields` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `client_custom_field_values_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `dashboard_widget_preferences` -- ALTER TABLE `dashboard_widget_preferences` ADD CONSTRAINT `dashboard_widget_preferences_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `files` -- ALTER TABLE `files` ADD CONSTRAINT `files_folder_id_foreign` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `files_previous_file_id_foreign` FOREIGN KEY (`previous_file_id`) REFERENCES `files` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `files_released_by_foreign` FOREIGN KEY (`released_by`) REFERENCES `users` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `files_uploaded_by_foreign` FOREIGN KEY (`uploaded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `files_version_root_id_foreign` FOREIGN KEY (`version_root_id`) REFERENCES `files` (`id`) ON DELETE SET NULL; -- -- Constraints for table `file_assignments` -- ALTER TABLE `file_assignments` ADD CONSTRAINT `file_assignments_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE; -- -- Constraints for table `file_comments` -- ALTER TABLE `file_comments` ADD CONSTRAINT `file_comments_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `file_comments_client_context_id_foreign` FOREIGN KEY (`client_context_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `file_comments_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE; -- -- Constraints for table `folders` -- ALTER TABLE `folders` ADD CONSTRAINT `folders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `folders_home_for_user_id_foreign` FOREIGN KEY (`home_for_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `folders_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `folders` (`id`) ON DELETE SET NULL; -- -- Constraints for table `folder_assignments` -- ALTER TABLE `folder_assignments` ADD CONSTRAINT `folder_assignments_folder_id_foreign` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE CASCADE; -- -- Constraints for table `group_members` -- ALTER TABLE `group_members` ADD CONSTRAINT `group_members_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `group_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `invitations` -- ALTER TABLE `invitations` ADD CONSTRAINT `invitations_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `invitations_invited_by_id_foreign` FOREIGN KEY (`invited_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL; -- -- Constraints for table `mcp_authorization_codes` -- ALTER TABLE `mcp_authorization_codes` ADD CONSTRAINT `mcp_authorization_codes_mcp_client_id_foreign` FOREIGN KEY (`mcp_client_id`) REFERENCES `mcp_clients` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `mcp_authorization_codes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `mcp_connections` -- ALTER TABLE `mcp_connections` ADD CONSTRAINT `mcp_connections_mcp_client_id_foreign` FOREIGN KEY (`mcp_client_id`) REFERENCES `mcp_clients` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `mcp_connections_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `membership_requests` -- ALTER TABLE `membership_requests` ADD CONSTRAINT `membership_requests_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `membership_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `notifications` -- ALTER TABLE `notifications` ADD CONSTRAINT `notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `notification_preferences` -- ALTER TABLE `notification_preferences` ADD CONSTRAINT `notification_preferences_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `pending_notifications` -- ALTER TABLE `pending_notifications` ADD CONSTRAINT `pending_notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `role_permission` -- ALTER TABLE `role_permission` ADD CONSTRAINT `role_permission_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; -- -- Constraints for table `share_links` -- ALTER TABLE `share_links` ADD CONSTRAINT `share_links_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL; -- -- Constraints for table `social_accounts` -- ALTER TABLE `social_accounts` ADD CONSTRAINT `social_accounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `staff_client_assignments` -- ALTER TABLE `staff_client_assignments` ADD CONSTRAINT `staff_client_assignments_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `staff_client_assignments_staff_id_foreign` FOREIGN KEY (`staff_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `upload_sessions` -- ALTER TABLE `upload_sessions` ADD CONSTRAINT `upload_sessions_folder_id_foreign` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `upload_sessions_previous_file_id_foreign` FOREIGN KEY (`previous_file_id`) REFERENCES `files` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `upload_sessions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `users` -- ALTER TABLE `users` ADD CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE RESTRICT; -- -- Constraints for table `zip_downloads` -- ALTER TABLE `zip_downloads` ADD CONSTRAINT `zip_downloads_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`) ON DELETE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;