CREATE TABLE `contact_form_types` (
  `id` int PRIMARY KEY AUTO_INCREMENT,
  `label` varchar(255),
  `identifier` varchar(255)
);

CREATE TABLE `contact_form_details` (
  `id` int PRIMARY KEY AUTO_INCREMENT,
  `form_id` int,
  `field_id` int,
  `created_at` timestamp
);

CREATE TABLE `contact_form_fields` (
  `id` int PRIMARY KEY AUTO_INCREMENT,
  `label` varchar(255),
  `input_name` varchar(255)
);

CREATE TABLE `contact_form_field_status` (
  `form_id` int,
  `field_id` int
);

ALTER TABLE `contact_form_details` ADD FOREIGN KEY (`form_id`) REFERENCES `contact_form_types` (`id`);

ALTER TABLE `contact_form_details` ADD FOREIGN KEY (`field_id`) REFERENCES `contact_form_fields` (`id`);

ALTER TABLE `contact_form_field_status` ADD FOREIGN KEY (`form_id`) REFERENCES `contact_form_types` (`id`);

ALTER TABLE `contact_form_field_status` ADD FOREIGN KEY (`field_id`) REFERENCES `contact_form_fields` (`id`);
