Fix device type inference and add computer category

This commit is contained in:
2026-04-10 17:54:04 +08:00
parent 0cb08642aa
commit b76f51a1aa
5 changed files with 2920 additions and 2877 deletions
+31 -1
View File
@@ -23,6 +23,36 @@ DEALLOCATE PREPARE stmt;
USE `mobilemodels`;
SET @drop_stmt = (
SELECT CASE `TABLE_TYPE`
WHEN 'BASE TABLE' THEN 'DROP TABLE `mm_device_catalog`'
WHEN 'VIEW' THEN 'DROP VIEW `mm_device_catalog`'
ELSE 'DO 0'
END
FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA` = 'mobilemodels' AND `TABLE_NAME` = 'mm_device_catalog'
LIMIT 1
);
SET @drop_stmt = COALESCE(@drop_stmt, 'DO 0');
PREPARE stmt FROM @drop_stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @drop_stmt = (
SELECT CASE `TABLE_TYPE`
WHEN 'BASE TABLE' THEN 'DROP TABLE `mm_brand_lookup`'
WHEN 'VIEW' THEN 'DROP VIEW `mm_brand_lookup`'
ELSE 'DO 0'
END
FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA` = 'mobilemodels' AND `TABLE_NAME` = 'mm_brand_lookup'
LIMIT 1
);
SET @drop_stmt = COALESCE(@drop_stmt, 'DO 0');
PREPARE stmt FROM @drop_stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @drop_stmt = (
SELECT CASE `TABLE_TYPE`
WHEN 'BASE TABLE' THEN 'DROP TABLE `mm_device_record`'
@@ -107,7 +137,7 @@ CREATE TABLE IF NOT EXISTS `mm_device_catalog` (
`manufacturer_brand` varchar(64) NOT NULL,
`parent_brand` varchar(64) NOT NULL,
`market_brand` varchar(64) NOT NULL,
`device_type` enum('phone','tablet','wear','tv','other') NOT NULL,
`device_type` enum('phone','tablet','wear','tv','computer','other') NOT NULL,
`code` varchar(64) DEFAULT NULL,
`code_alias` varchar(255) DEFAULT NULL,
`ver_name` text DEFAULT NULL,