add unique index for registry_no in school

parent cb452fd6
......@@ -147,25 +147,26 @@ DROP TABLE IF EXISTS `school`;
CREATE TABLE `school` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`registry_no` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(191) CHARACTER SET utf8mb4 NOT NULL,
`street_address` varchar(191) CHARACTER SET utf8mb4 NOT NULL,
`postal_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone_number` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`fax_number` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`municipality` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`street_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`postal_code` int(11) unsigned DEFAULT NULL,
`phone_number` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fax_number` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`municipality` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`schooltype_id` int(11) unsigned NOT NULL,
`prefecture_id` int(11) unsigned NOT NULL,
`educationlevel_id` int(11) unsigned NOT NULL,
`eduadmin_id` int(11) unsigned NOT NULL,
`created` int(11) unsigned NOT NULL,
`creator` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`creator` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `registry_no_UNIQUE` (`registry_no`),
KEY `index_foreignkey_school_schooltype` (`schooltype_id`),
KEY `index_foreignkey_school_prefecture` (`prefecture_id`),
KEY `index_foreignkey_school_educationlevel` (`educationlevel_id`),
KEY `index_foreignkey_school_eduadmin` (`eduadmin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment