CREATE TABLE gkno (
id_gkno int(11) NOT NULL,
code_gkno bigint(20) NOT NULL,
nasvanie_gkno varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (id_gkno) USING BTREE,
INDEX code_gkno(code_gkno) USING BTREE,
INDEX nasvanie_gkno(nasvanie_gkno) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE vbr (
id_vbr int(11) NOT NULL,
code_vbr bigint(20) NOT NULL,
nasvanie_vbr varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
vid_vbr_id int(11) NOT NULL,
vid_vbr_code bigint(20) NOT NULL,
vid_vbr_nasvanie varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (id_vbr) USING BTREE,
INDEX code_vbr(code_vbr) USING BTREE,
INDEX nasvanie_vbr(nasvanie_vbr) USING BTREE,
INDEX FK_vbr_vid_vbr_id(vid_vbr_id) USING BTREE,
INDEX FK_vbr_vid_vbr_code(vid_vbr_code) USING BTREE,
INDEX FK_vbr_vid_vbr_nasvanie(vid_vbr_nasvanie) USING BTREE,
CONSTRAINT FK_vbr_vid_vbr_code FOREIGN KEY (vid_vbr_code) REFERENCES vid_vbr (code_vid_vbr) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_vid_vbr_id FOREIGN KEY (vid_vbr_id) REFERENCES vid_vbr (id_vid_vbr) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_vid_vbr_nasvanie FOREIGN KEY (vid_vbr_nasvanie) REFERENCES vid_vbr (nasvanie_vid_vbr) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE vbr_to_more_gkno (
id_vbr_to_more_gkno int(11) NOT NULL,
vbr_id int(11) NOT NULL,
vbr_code bigint(20) NOT NULL,
vbr_nasvanie varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
gkno_id int(11) NOT NULL,
gkno_code bigint(20) NOT NULL,
gkno_nasvanie varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (id_vbr_to_more_gkno) USING BTREE,
INDEX FK_vbr_to_more_gkno_vbr_id(vbr_id) USING BTREE,
INDEX FK_vbr_to_more_gkno_vbr_code(vbr_code) USING BTREE,
INDEX FK_vbr_to_more_gkno_vbr_nasvanie(vbr_nasvanie) USING BTREE,
INDEX FK_vbr_to_more_gkno_id(gkno_id) USING BTREE,
INDEX FK_vbr_to_more_gkno_code(gkno_code) USING BTREE,
INDEX FK_vbr_to_more_gkno_nasvanie(gkno_nasvanie) USING BTREE,
CONSTRAINT FK_vbr_to_more_gkno_code FOREIGN KEY (gkno_code) REFERENCES gkno (code_gkno) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_to_more_gkno_id FOREIGN KEY (gkno_id) REFERENCES gkno (id_gkno) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_to_more_gkno_nasvanie FOREIGN KEY (gkno_nasvanie) REFERENCES gkno (nasvanie_gkno) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_to_more_gkno_vbr_code FOREIGN KEY (vbr_code) REFERENCES vbr (code_vbr) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_to_more_gkno_vbr_id FOREIGN KEY (vbr_id) REFERENCES vbr (id_vbr) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_vbr_to_more_gkno_vbr_nasvanie FOREIGN KEY (vbr_nasvanie) REFERENCES vbr (nasvanie_vbr) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE vid_vbr (
id_vid_vbr int(11) NOT NULL,
code_vid_vbr bigint(20) NOT NULL,
nasvanie_vid_vbr varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (id_vid_vbr) USING BTREE,
INDEX code_vid_vbr(code_vid_vbr) USING BTREE,
INDEX nasvanie_vid_vbr(nasvanie_vid_vbr) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; на основе вышеуказанного кода сформировать код flask admin так чтобы все поля в формах редактирования представляли собой выпадающие списки с вариантами выбора значений подгружаемых из базы данных