· 7 years ago · Nov 29, 2018, 08:32 PM
1CREATE TABLE IF NOT EXISTS `setting` (
2 `uuid` INT(10) NOT NULL,
3 `type` VARCHAR(255) NOT NULL,
4 `code` VARCHAR(255) NOT NULL COMMENT 'An unique name.',
5 `value` MEDIUMTEXT NULL DEFAULT NULL,
6 `comment` LONGTEXT NULL DEFAULT NULL,
7 `created_on` INT UNSIGNED NOT NULL,
8 `updated_on` INT UNSIGNED NOT NULL,
9 PRIMARY KEY (`uuid`))
10ENGINE = MyISAM
11DEFAULT CHARACTER SET = utf8;
12
13CREATE UNIQUE INDEX `name_UNIQUE` ON `setting` (`code` ASC) VISIBLE;
14
15CREATE UNIQUE INDEX `uuid_UNIQUE` ON `setting` (`uuid` ASC) VISIBLE;
16
17CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
18 [index_type]
19 ON tbl_name (key_part,...)
20 [index_option]
21 [algorithm_option | lock_option] ...
22
23key_part: {col_name [(length)] | (expr)} [ASC | DESC]
24
25index_option:
26 KEY_BLOCK_SIZE [=] value
27 | index_type
28 | WITH PARSER parser_name
29 | COMMENT 'string'
30 | {VISIBLE | INVISIBLE} /* Notice the option of VISIBLE / INVISIBLE */
31
32index_type:
33 USING {BTREE | HASH}
34
35CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
36 [index_type]
37 ON tbl_name (key_part,...)
38 [index_option]
39 [algorithm_option | lock_option] ...
40
41key_part:
42 col_name [(length)] [ASC | DESC]
43
44index_option:
45 KEY_BLOCK_SIZE [=] value
46 | index_type
47 | WITH PARSER parser_name
48 | COMMENT 'string' /* No option of VISIBLE / INVISIBLE */
49
50index_type:
51 USING {BTREE | HASH}