2017-03-01 76 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

非常感謝..做到了這一點! –

相關問題