1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2024-09-20 04:35:51 +00:00

feat(sql): 优化数据表结构

This commit is contained in:
Carm Jos 2022-08-11 17:43:42 +08:00
parent 6883a464db
commit f61294c5f3
4 changed files with 18 additions and 8 deletions

View File

@ -24,6 +24,8 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -51,7 +51,7 @@ public class SQLSectionWrapper implements ConfigurationWrapper {
} }
@Override @Override
public @Nullable ConfigurationWrapper getConfigurationSection(@NotNull String path) { public @Nullable SQLSectionWrapper getConfigurationSection(@NotNull String path) {
return null; return null;
} }

View File

@ -0,0 +1,7 @@
package cc.carm.lib.configuration.sql;
public class SQLValueParser {
}

View File

@ -1,13 +1,14 @@
CREATE TABLE IF NOT EXISTS conf CREATE TABLE IF NOT EXISTS conf
( (
`namespace` VARCHAR(255) NOT NULL, # 记录配置文件的命名空间 `namespace` VARCHAR(255) NOT NULL, # 命名空间
`section` VARCHAR(255) NOT NULL, # 记录配置文件数值的指定路径 `section` VARCHAR(255) NOT NULL, # 配置路径 (ConfigPath)
`type` VARCHAR(255) NOT NULL, `type` VARCHAR(255) NOT NULL, # 数据类型 (Integer/Byte/List/Map/...)
`value` LONGTEXT, # 记录该配置项的值 (可能为JSON格式) `value` MEDIUMTEXT, # 配置项的值 (可能为JSON格式)
`inline_comments` TEXT, # 记录配置文件的行内注释 `inline_comments` TINYTEXT, # 行内注释
`header_comments` MEDIUMTEXT, # 记录配置文件的顶部注释 `header_comments` TEXT, # 顶部注释
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`namespace`, `section`) PRIMARY KEY (`namespace`, `section`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4; DEFAULT CHARSET = utf8mb4;