forked from easysoft/zendata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for database field definition (easysoft#25)
* 除整型外,其余字段range属性使用双引号包括 * 字符串类型、时间类型生成与默认配置相符 * field_test.yaml为示例文件
- Loading branch information
Showing
2 changed files
with
204 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
CREATE TABLE `field_test` ( | ||
`Bit` bit(64) NULL DEFAULT NULL, | ||
`TinyInt` tinyint NULL DEFAULT NULL, | ||
`SmallInt` smallint NULL DEFAULT NULL, | ||
`MediumInt` mediumint NULL DEFAULT NULL, | ||
`GeometryCollection` GEOMETRYCOLLECTION NULL, | ||
`Int` int NULL DEFAULT NULL, | ||
`BigInt` bigint NULL DEFAULT NULL, | ||
`Float(M,D)` float NULL DEFAULT NULL, | ||
`Double(M,D)` double NULL DEFAULT NULL, | ||
`Decimal(M,D)` decimal(10,0) NULL DEFAULT NULL, | ||
`Date` date NULL DEFAULT NULL, | ||
`DateTime` datetime NULL DEFAULT NULL, | ||
`TimeStamp` datetime NULL DEFAULT NULL, | ||
`Time` time NULL DEFAULT NULL, | ||
`Year` year NULL DEFAULT NULL, | ||
`Char` char(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, | ||
`VarChar(M)` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, | ||
`Binary(M)` binary(255) NULL DEFAULT NULL, | ||
`TinyText` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL, | ||
`Text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, | ||
`MediumText` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL, | ||
`LongText` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL, | ||
`TinyBlob` tinyblob NULL, | ||
`Blob` blob NULL, | ||
`MediumBlob` mediumblob NULL, | ||
`LongBlob` longblob NULL, | ||
`Enum` enum('1','2') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, | ||
`Set` set('set1','set2') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '', | ||
`Geometry` geometry NULL, | ||
`Point` point NULL, | ||
`LineString` linestring NULL, | ||
`Polygon` polygon NULL, | ||
`MultiPoint` multipoint NULL, | ||
`MultiLineString` multilinestring NULL, | ||
`MultiPolygon` multipolygon NULL | ||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; | ||
|
||
SET FOREIGN_KEY_CHECKS = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters