camry / mysqldiff Goto Github PK
View Code? Open in Web Editor NEWGolang 针对 MySQL 数据库表结构的差异 SQL 工具。
License: MIT License
Golang 针对 MySQL 数据库表结构的差异 SQL 工具。
License: MIT License
source中没有的表,在target中有,此时生成的 create 语句没有索引信息
mysqldiff -c --source root:123456@localhost:3306 -d test_a:test_b
兄弟你得这个项目很好用。基于命令行得速度很快,好用。发展方向很不错。 之前mysql那个mysqldiff 已经停止更新了。兄弟这个go版本很好。速度66的 但是很多功能没有更新上,如果能扛起大旗,希望能得到持续更新。建议能打造一个和 Compare Bundle for MySQL 项目媲美命令行
DB1 table ABC DB2 table AB
mysqldiff DB1 DB2
对于target不存在的表,支持生成create table C么
兄弟你好。你得开源软件很不错,希望能继续维护。感激不尽
但是很不幸,有几个bug
我测试得方法
./mysqldiff -c -d worker_db_831321:test -s root:[email protected]:3306 -t root:[email protected]:3306 >ff.sql
lianhuazi@lianhuazi-PC:~/go-mysqldiff$ mysql -uroot -h172.17.0.1 -p123456 test<ff.sql
ERROR 1064 (42000) at line 7365: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-00-00 00:00:00 COMMENT '',
PRIMARY KEY (`id`),
1 丢失引号
发现结构生成丢失数据 导致sql 导入 错误,我做比较。发现是少了一对引号 去源结构查看是存在
源:
比对得到sql:
2 和Navicat 工具得结构对比。有丢失结构得情况
为了检查准确 我通过navicat 得结构同步做了对比。发现还有很多结构丢失
这个工具不能比对 表名不同的结构对比吗?
如果有参数db.table 就好了,希望表名不能 手动指定命名就行对比
不错的项目,希望大佬能将cmd里面的补全命令操作方法一系列的能写到readme.md中
是不是和数据库版本有关系 我是5.6的mysql
Error 1054: Unknown column 'GENERATION_EXPRESSION' in 'field list'
这么好的一个工具。
./mysqldiff --source '***:***@***:*** ' --target '***:***@***:***6' --db cw_xwl_alpha_sys:cw_xwl_stg_sys
SET NAMES utf8mb4;
ALTER TABLE `sys_auto_job`
MODIFY COLUMN `id` bigint(20) NOT NULL FIRST,
MODIFY COLUMN `tenant_id` bigint(20) DEFAULT NULL AFTER `job_result`,
MODIFY COLUMN `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `create_user`,
MODIFY COLUMN `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `update_user`;
ALTER TABLE `sys_company`
MODIFY COLUMN `id` bigint(20) NOT NULL FIRST,
MODIFY COLUMN `expire_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `level_previous`,
MODIFY COLUMN `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `create_user`,
MODIFY COLUMN `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `update_user`
兄弟这个项目又更新,66666
有如下建议,不知道能不能考虑一下
看到兄弟加了很多功能选项,是否考虑考虑把这这些以参数方式来启用相应得功能
原:
Flags:
-c, --comment 是否生成注释?
-d, --db string 指定数据库。(格式: <source_db>:<target_db>)
-h, --help help for mysqldiff
-s, --source string 指定源服务器。(格式: <user>:<password>@<host>:<port>)
-t, --target string 指定目标服务器。(格式: <user>:<password>@<host>:<port>)
-i, --tidb 是否 TiDB ?
-v, --version version for mysqldiff
可否考虑:
Flags:
-c, --comment 是否生成注释?
-d, --db string 指定数据库。(格式: <source_db>:<target_db>)
-h, --help help for mysqldiff
-s, --source string 指定源服务器。(格式: <user>:<password>@<host>:<port>)
-t, --target string 指定目标服务器。(格式: <user>:<password>@<host>:<port>)
-i, --tidb 是否 TiDB ?
-v, --version version for mysqldiff
-m [主键|外键|索引|触发器|视图] 除了基础必要有硬性自带,一些附加功能用参数模块来启用。这样做得好处就是可以
让用户根据自己需求来启用,也能让软件速度最大化。
在TIDB中一次只能更新一个字段,这样做为了兼容TIDB。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.