For me, ./lnms migrate was unable to recreate the two tables after dropping them. For anyone running into the same, here are the table schemas to quickly recreate them.
port_groups:
CREATE TABLE `port_groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `port_groups_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
port_group_port:
CREATE TABLE `port_group_port` (
`port_group_id` int(10) unsigned NOT NULL,
`port_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`port_group_id`,`port_id`),
KEY `port_group_port_port_group_id_index` (`port_group_id`),
KEY `port_group_port_port_id_index` (`port_id`),
CONSTRAINT `port_group_port_port_group_id_foreign` FOREIGN KEY (`port_group_id`) REFERENCES `port_groups` (`id`) ON DELETE CASCADE,
CONSTRAINT `port_group_port_port_id_foreign` FOREIGN KEY (`port_id`) REFERENCES `ports` (`port_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Run ./lnms migrate again, and it should complete.
*Edited to make sure backticks show