博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
记一次:django models到sqlalchemy models重构
阅读量:2778 次
发布时间:2019-05-13

本文共 19038 字,大约阅读时间需要 63 分钟。

部署本地开发环境的django应用,初始化数据库设置

PythonWebDev\web_develop\network\networkconsole-master\networkconsole\conf.py

import osDEBUG = TrueALLOWED_HOSTS = ['*']DB_NAME = os.getenv("DB_NAME", "nms_console")DB_USER = os.getenv("DB_USER", 'root')DB_PASSWORD = os.getenv("DB_PASSWORD", '')DB_HOST = os.getenv("DB_HOST", "localhost")DB_PORT = int(os.getenv("DB_PORT", "3306"))REDIS_HOST = os.getenv("REDIS_HOST", '127.0.0.1')REDIS_PORT = int(os.getenv("REDIS_PORT", '6379'))LDAP_SERVER_URI = os.getenv("LDAP_SERVER_URI", 'ldap://10.222.10.244:389')LDAP_PASSWORD = os.getenv("LDAP_PASSWORD", 'OUm6Wau+VuBX')LOCK_FILE_PATH = '/ikglobal/lock/'MESSAGE_PATH = '/ikglobal/logs/message.log'LOG_REQUEST_ERROR_PATH = '/ikglobal/logs/request_error.log'LOG_SQL_PATH = '/ikglobal/logs/sql.log'

将jango的sql mode映射到数据库

python manage.py migrate

查看生成的对应数据库和表

映射sql到sqlalchemy models

(vpp_agent_venv3.7) [root@localhost model]# pip install sqlacodegen(vpp_agent_venv3.7) [root@localhost model]# sqlacodegen --outfile=nms_routein.py mysql+pymysql://root:123456@127.0.0.1:3306/nms_console(vpp_agent_venv3.7) [root@localhost model]# lsbase_model.py  models2.py  models_mongo.py  models.py  nms_routein.py  __pycache__  route_in.py

通过navicat导出数据库结构

点击nms_console,右键选择转存sql文件数据和结构

/* Navicat Premium Data Transfer Source Server         : 127.0.0.1 Source Server Type    : MySQL Source Server Version : 50721 Source Host           : 127.0.0.1:3306 Source Schema         : nms_console Target Server Type    : MySQL Target Server Version : 50721 File Encoding         : 65001 Date: 11/09/2019 20:25:28*/SET NAMES utf8mb4;SET FOREIGN_KEY_CHECKS = 0;-- ------------------------------ Table structure for common_config-- ----------------------------DROP TABLE IF EXISTS `common_config`;CREATE TABLE `common_config`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `common_config_name_room_id_50e7a3f4_uniq`(`name`, `room_id`) USING BTREE,  INDEX `common_config_room_id_1687cb8f_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `common_config_room_id_1687cb8f_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for common_local_config-- ----------------------------DROP TABLE IF EXISTS `common_local_config`;CREATE TABLE `common_local_config`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `common_local_config_name_room_id_2352bdaa_uniq`(`name`, `room_id`) USING BTREE,  INDEX `common_local_config_room_id_177281a0_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `common_local_config_room_id_177281a0_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for common_room-- ----------------------------DROP TABLE IF EXISTS `common_room`;CREATE TABLE `common_room`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `enable_qy` tinyint(1) NOT NULL,  `enable_route` tinyint(1) NOT NULL,  `server_url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `secret_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `weight` int(11) NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Records of common_room-- ----------------------------INSERT INTO `common_room` VALUES ('d1105c29-2871-4fe9-a275-afe4ada734a2', 'test', 1, 1, 'http://10.1.252.22:8001', 'system', 'c8245a353402df39bd271d66fb5ce0b5fba87e63', 0);-- ------------------------------ Table structure for in_community_group-- ----------------------------DROP TABLE IF EXISTS `in_community_group`;CREATE TABLE `in_community_group`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `name`(`name`) USING BTREE,  INDEX `in_community_group_room_id_8ebde5de_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `in_community_group_room_id_8ebde5de_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_community_line-- ----------------------------DROP TABLE IF EXISTS `in_community_line`;CREATE TABLE `in_community_line`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `lft` int(10) UNSIGNED NOT NULL,  `rght` int(10) UNSIGNED NOT NULL,  `tree_id` int(10) UNSIGNED NOT NULL,  `level` int(10) UNSIGNED NOT NULL,  `parent_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  INDEX `in_community_line_room_id_0aa1b1cd_fk_common_room_uuid`(`room_id`) USING BTREE,  INDEX `in_community_line_lft_7fd98161`(`lft`) USING BTREE,  INDEX `in_community_line_rght_d2de5471`(`rght`) USING BTREE,  INDEX `in_community_line_tree_id_247cf493`(`tree_id`) USING BTREE,  INDEX `in_community_line_level_772a9cbc`(`level`) USING BTREE,  INDEX `in_community_line_parent_id_f2bfc602`(`parent_id`) USING BTREE,  CONSTRAINT `in_community_line_parent_id_f2bfc602_fk_in_community_line_uuid` FOREIGN KEY (`parent_id`) REFERENCES `in_community_line` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_community_line_room_id_0aa1b1cd_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_community_manager-- ----------------------------DROP TABLE IF EXISTS `in_community_manager`;CREATE TABLE `in_community_manager`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `community` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `main_switch` tinyint(1) NOT NULL,  `weight` int(11) NOT NULL,  `line_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `copy_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `in_community_manager_community_room_id_82499a71_uniq`(`community`, `room_id`) USING BTREE,  INDEX `in_community_Manager_line_id_af4ee501_fk_in_community_line_uuid`(`line_id`) USING BTREE,  INDEX `in_community_Manager_room_id_f7d2a7e7_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `in_community_Manager_line_id_af4ee501_fk_in_community_line_uuid` FOREIGN KEY (`line_id`) REFERENCES `in_community_line` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_community_Manager_room_id_f7d2a7e7_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_community_template-- ----------------------------DROP TABLE IF EXISTS `in_community_template`;CREATE TABLE `in_community_template`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  INDEX `in_community_template_room_id_79d54d56_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `in_community_template_room_id_79d54d56_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_group_many_community-- ----------------------------DROP TABLE IF EXISTS `in_group_many_community`;CREATE TABLE `in_group_many_community`  (  `id` int(11) NOT NULL AUTO_INCREMENT,  `communitygroup_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `communitymanager_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`id`) USING BTREE,  UNIQUE INDEX `in_group_many_community_communitygroup_id_commun_f8ea338b_uniq`(`communitygroup_id`, `communitymanager_id`) USING BTREE,  INDEX `in_group_many_commun_communitymanager_id_3f227d8d_fk_in_commun`(`communitymanager_id`) USING BTREE,  CONSTRAINT `in_group_many_commun_communitygroup_id_4cd68e69_fk_in_commun` FOREIGN KEY (`communitygroup_id`) REFERENCES `in_community_group` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_group_many_commun_communitymanager_id_3f227d8d_fk_in_commun` FOREIGN KEY (`communitymanager_id`) REFERENCES `in_community_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_ip_attribute-- ----------------------------DROP TABLE IF EXISTS `in_ip_attribute`;CREATE TABLE `in_ip_attribute`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  INDEX `in_ip_attribute_room_id_d37fd4d6_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `in_ip_attribute_room_id_d37fd4d6_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_ip_manager-- ----------------------------DROP TABLE IF EXISTS `in_ip_manager`;CREATE TABLE `in_ip_manager`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `node` int(11) NULL DEFAULT NULL,  `modify_reason` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `status` int(11) NOT NULL,  `status_changed` double NOT NULL,  `qy_status_line` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `community_change` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,  `attribute_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `group_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `policy_name_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `router_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `template_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `in_ip_manager_ip_room_id_4082deca_uniq`(`ip`, `room_id`) USING BTREE,  INDEX `in_ip_manager_attribute_id_739a2131_fk_in_ip_attribute_uuid`(`attribute_id`) USING BTREE,  INDEX `in_ip_manager_group_id_8609ecf1_fk_in_community_group_uuid`(`group_id`) USING BTREE,  INDEX `in_ip_manager_policy_name_id_a4a5feda_fk_in_router`(`policy_name_id`) USING BTREE,  INDEX `in_ip_manager_room_id_01a6f6a1_fk_common_room_uuid`(`room_id`) USING BTREE,  INDEX `in_ip_manager_router_id_d2106453_fk_in_router_manager_uuid`(`router_id`) USING BTREE,  INDEX `in_ip_manager_template_id_6680b7db_fk_in_community_template_uuid`(`template_id`) USING BTREE,  CONSTRAINT `in_ip_manager_attribute_id_739a2131_fk_in_ip_attribute_uuid` FOREIGN KEY (`attribute_id`) REFERENCES `in_ip_attribute` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_manager_group_id_8609ecf1_fk_in_community_group_uuid` FOREIGN KEY (`group_id`) REFERENCES `in_community_group` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_manager_policy_name_id_a4a5feda_fk_in_router` FOREIGN KEY (`policy_name_id`) REFERENCES `in_router_policyname` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_manager_room_id_01a6f6a1_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_manager_router_id_d2106453_fk_in_router_manager_uuid` FOREIGN KEY (`router_id`) REFERENCES `in_router_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_manager_template_id_6680b7db_fk_in_community_template_uuid` FOREIGN KEY (`template_id`) REFERENCES `in_community_template` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_ip_many_community-- ----------------------------DROP TABLE IF EXISTS `in_ip_many_community`;CREATE TABLE `in_ip_many_community`  (  `id` int(11) NOT NULL AUTO_INCREMENT,  `ipmanager_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `communitymanager_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`id`) USING BTREE,  UNIQUE INDEX `in_ip_many_community_ipmanager_id_communityma_4779c35e_uniq`(`ipmanager_id`, `communitymanager_id`) USING BTREE,  INDEX `in_ip_many_community_communitymanager_id_9a85914f_fk_in_commun`(`communitymanager_id`) USING BTREE,  CONSTRAINT `in_ip_many_community_communitymanager_id_9a85914f_fk_in_commun` FOREIGN KEY (`communitymanager_id`) REFERENCES `in_community_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_ip_many_community_ipmanager_id_ab0a111d_fk_in_ip_manager_uuid` FOREIGN KEY (`ipmanager_id`) REFERENCES `in_ip_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_router_manager-- ----------------------------DROP TABLE IF EXISTS `in_router_manager`;CREATE TABLE `in_router_manager`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `ip` char(39) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `alias` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `port` int(11) NOT NULL,  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `manufacturer` int(11) NOT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  UNIQUE INDEX `ip`(`ip`) USING BTREE,  INDEX `in_router_manager_room_id_b8402dd7_fk_common_room_uuid`(`room_id`) USING BTREE,  CONSTRAINT `in_router_manager_room_id_b8402dd7_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Records of in_router_manager-- ----------------------------INSERT INTO `in_router_manager` VALUES ('dssdgsdg', '1.1.1.1', 'NE40', 22, 'test', 'test', 1, 'd1105c29-2871-4fe9-a275-afe4ada734a2');-- ------------------------------ Table structure for in_router_policyname-- ----------------------------DROP TABLE IF EXISTS `in_router_policyname`;CREATE TABLE `in_router_policyname`  (  `uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  `room_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `router_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`uuid`) USING BTREE,  INDEX `in_router_policyname_room_id_57ad0c32_fk_common_room_uuid`(`room_id`) USING BTREE,  INDEX `in_router_policyname_router_id_28262f1d_fk_in_router`(`router_id`) USING BTREE,  CONSTRAINT `in_router_policyname_room_id_57ad0c32_fk_common_room_uuid` FOREIGN KEY (`room_id`) REFERENCES `common_room` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_router_policyname_router_id_28262f1d_fk_in_router` FOREIGN KEY (`router_id`) REFERENCES `in_router_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;-- ------------------------------ Table structure for in_template_many_community-- ----------------------------DROP TABLE IF EXISTS `in_template_many_community`;CREATE TABLE `in_template_many_community`  (  `id` int(11) NOT NULL AUTO_INCREMENT,  `communitytemplate_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  `communitymanager_id` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,  PRIMARY KEY (`id`) USING BTREE,  UNIQUE INDEX `in_template_many_communi_communitytemplate_id_com_b8b6f4d3_uniq`(`communitytemplate_id`, `communitymanager_id`) USING BTREE,  INDEX `in_template_many_com_communitymanager_id_a1a9ec6a_fk_in_commun`(`communitymanager_id`) USING BTREE,  CONSTRAINT `in_template_many_com_communitymanager_id_a1a9ec6a_fk_in_commun` FOREIGN KEY (`communitymanager_id`) REFERENCES `in_community_manager` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,  CONSTRAINT `in_template_many_com_communitytemplate_id_f2a3e702_fk_in_commun` FOREIGN KEY (`communitytemplate_id`) REFERENCES `in_community_template` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;SET FOREIGN_KEY_CHECKS = 1;

逆向数据库到模型

转载地址:http://esfld.baihongyu.com/

你可能感兴趣的文章
MySQL server has gone away
查看>>
SQL Server2005中删除重复行
查看>>
重签劳动合同,公司会害我吗?
查看>>
从功夫熊猫看软件开发的三个要点
查看>>
oracle 查询数据库重复的字段
查看>>
累了--一个女程序员的心酸和无奈
查看>>
Zend_Cache 的基本用法
查看>>
豆瓣的 Web 服务器
查看>>
为什么说OpenSocial只不过是一个公关骗局?
查看>>
Zend Studio for Eclipse 6.01
查看>>
linux中的tr命令---字符的替换与删除
查看>>
分布式缓存BeIT Memcached简介
查看>>
云计算应用正在增长 五大趋势推动发展
查看>>
北美PC游戏销量排行榜
查看>>
《财富》推荐的75本必读书 (修订版)
查看>>
memcache分析调试
查看>>
Google Chrome,太快了,有些不适应
查看>>
think in baidu
查看>>
疯狂的程序员75
查看>>
疯狂的程序员77
查看>>