By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE `partner` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ico` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created` datetime NOT NULL,
`active` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `partner_idx_active` (`active`),
FULLTEXT KEY `partnerEntity` (`name`,`ico`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `partner` (`id`, `name`, `ico`, `created`, `active`) VALUES
(1, 'partner1', '123', '2021-05-18 22:27:24', 1);
CREATE TABLE `contact` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`partner_id` int(11) DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tel` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created` datetime NOT NULL,
`active` int(11) NOT NULL,
`main` int(11) DEFAULT NULL,
`important` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_4C62E6389393F8FE` (`partner_id`),
FULLTEXT KEY `contactEntity` (`name`,`email`,`tel`),
CONSTRAINT `FK_4C62E6389393F8FE` FOREIGN KEY (`partner_id`) REFERENCES `partner` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `contact` (`id`, `partner_id`, `name`, `email`, `tel`, `created`, `active`, `main`, `important`) VALUES
(1, 1, 'contact1', 'test@test.com', '123456789', '2021-05-18 22:28:30', 1, 1, NULL),
(2, 1, 'contact2', 'test2@test.com', '123456788', '2021-05-18 22:28:48', 1, NULL, 1),
(3, 1, 'contact3', 'test3@test.com', '123451234', '2021-05-18 22:29:13', 1, NULL, NULL);