Skip to content

Instantly share code, notes, and snippets.

@amitavroy
Created June 4, 2019 08:52
Show Gist options
  • Save amitavroy/8ecf8a648a021ba2e4d6c270b2789e47 to your computer and use it in GitHub Desktop.
Save amitavroy/8ecf8a648a021ba2e4d6c270b2789e47 to your computer and use it in GitHub Desktop.
Create the table for Telescope to work
CREATE TABLE `telescope_entries` (
`sequence` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`family_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`should_display_on_index` tinyint(1) NOT NULL DEFAULT 1,
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`sequence`),
UNIQUE KEY `telescope_entries_uuid_unique` (`uuid`),
KEY `telescope_entries_batch_id_index` (`batch_id`),
KEY `telescope_entries_type_should_display_on_index_index` (`type`,`should_display_on_index`),
KEY `telescope_entries_family_hash_index` (`family_hash`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
CREATE TABLE `telescope_entries_tags` (
`entry_uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`tag` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
KEY `telescope_entries_tags_entry_uuid_tag_index` (`entry_uuid`,`tag`),
KEY `telescope_entries_tags_tag_index` (`tag`),
CONSTRAINT `telescope_entries_tags_entry_uuid_foreign` FOREIGN KEY (`entry_uuid`) REFERENCES `telescope_entries` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
CREATE TABLE `telescope_monitoring` (
`tag` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment