2017-03-01 77 views
1

我有一个名为persons的MySQL数据库表。该表有两个枚举字段。在PhpMyAdmin他们是枚举。但是,PhpStorm将它们显示为字符。为什么enum字段在PhpStorm中显示为char

这里是phpMyAdmin的出口:

-- 
-- Database: `underdog` 
-- 

-- -------------------------------------------------------- 

-- 
-- Table structure for table `persons` 
-- 

CREATE TABLE `persons` (
    `person_id` bigint(20) UNSIGNED NOT NULL COMMENT 'ID for each person', 
    `username` varchar(12) CHARACTER SET ascii DEFAULT NULL, 
    `email` varchar(110) CHARACTER SET ascii DEFAULT NULL, 
    `created` bigint(20) UNSIGNED DEFAULT NULL, 
    `password` varchar(250) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL, 
    `notetoself` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Personal notes of user', 
    `is_blocked` tinyint(3) UNSIGNED NOT NULL DEFAULT '0', 
    `phptimezone` varchar(400) CHARACTER SET ascii DEFAULT NULL COMMENT 'example America/New_York', 
    `mobile_phone` varchar(10) CHARACTER SET ascii DEFAULT NULL COMMENT 'Mobile phone number', 
    `country_phonecode` varchar(6) CHARACTER SET ascii NOT NULL DEFAULT '1' COMMENT 'Prepend for country', 
    `membership_level` enum('Platinum','Gold','Silver','Bronze') CHARACTER SET ascii NOT NULL DEFAULT 'Bronze', 
    `realname` varchar(110) CHARACTER SET utf8 COLLATE utf8_swedish_ci DEFAULT NULL COMMENT 'Full name', 
    `karma_level` enum('5 Star','4 Star','3 Star','2 Star','1 Star') CHARACTER SET ascii NOT NULL DEFAULT '5 Star', 
    `times_blocked` mediumint(8) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Number of times this person has been blocked' 
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 

-- 
-- Indexes for dumped tables 
-- 

-- 
-- Indexes for table `persons` 
-- 
ALTER TABLE `persons` 
    ADD PRIMARY KEY (`person_id`), 
    ADD UNIQUE KEY `username` (`username`), 
    ADD UNIQUE KEY `email` (`email`), 
    ADD UNIQUE KEY `mobile_phone` (`mobile_phone`); 

-- 
-- AUTO_INCREMENT for dumped tables 
-- 

enter image description here

enter image description here

+0

PhpStorm版本? “ – LazyOne

+0

”PhpStorm将它们显示为字符。“ - 你什么意思?你能添加截图吗? –

+0

在Windows 10的PhpStorm 2016.3.2和MySQL 5.7.17中运行良好 - http://postimg.org/image/pomyycdah/ – LazyOne

回答

2

此问题已解决了150年前 - DBE-401

考虑到您正在使用最新的2017.1 EAP版本..这必须是由于您当前的设置。

根据您的YouTube视频 - 请在Data Source的Options选项卡上禁用Introspect using JDBC metadata选项。

enter image description here

+0

非常感谢..做到了这一点! –

相关问题