Used by:
- MySQL 5.7

There are several tables in which there is an ENUM type field.
Data for substitution in the field in all tables are the same.

Question.
How to make the data for substitution in fields of type ENUM used from one source?
Those. All tables use the same directory.

EG
Datasheet

CREATE TABLE `tst_001_tb_00` ( `id` INT(11) NOT NULL, `pl_1_txt` TEXT NULL, `pl_2_enum` ENUM('Y','N') NULL DEFAULT NULL, INDEX `id` (`id`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DYNAMIC ; 

Table HANDBOOK

 CREATE TABLE `tst_001_tb_01_sprch` ( `pl_2_enum` TEXT NULL ) COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DYNAMIC ; 
  • one
    to make foreign key enum fields on a data table - Bohdan Korinnyi
  • @BogdanK Added an example of tables to a question ... If it's not difficult for you to show the example of the tables I have given .. And then something does not work - koverflow
  • one
    get a separate table reference. in it, you give each value of "enum" an id and in the tables the field already declare not an enum, but a simple int, but additionally add a foreign key pointing to the directory. - Mike

0