GithubHelp home page GithubHelp logo

camry / mysqldiff Goto Github PK

View Code? Open in Web Editor NEW
70.0 70.0 28.0 148.51 MB

Golang 针对 MySQL 数据库表结构的差异 SQL 工具。

License: MIT License

Go 99.60% Shell 0.40%
golang mysql mysqldiff tidb

mysqldiff's People

Contributors

camry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mysqldiff's Issues

生成的sql没有索引信息

source中没有的表,在target中有,此时生成的 create 语句没有索引信息
mysqldiff -c --source root:123456@localhost:3306 -d test_a:test_b

功能反馈。希望加入触发器比较

兄弟你得这个项目很好用。基于命令行得速度很快,好用。发展方向很不错。 之前mysql那个mysqldiff 已经停止更新了。兄弟这个go版本很好。速度66的 但是很多功能没有更新上,如果能扛起大旗,希望能得到持续更新。建议能打造一个和 Compare Bundle for MySQL 项目媲美命令行

https://www.devart.com/dbforge/mysql/compare-bundle/?gclid=EAIaIQobChMIgt_bvIaf9QIVWBTUAR3IdgYREAAYASAAEgKlb_D_BwE

bug 反馈

兄弟你好。你得开源软件很不错,希望能继续维护。感激不尽
但是很不幸,有几个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 得结构同步做了对比。发现还有很多结构丢失

生成的sql 语句没有注释

生成的sql 语句没有注释

 ./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 [主键|外键|索引|触发器|视图] 除了基础必要有硬性自带,一些附加功能用参数模块来启用。这样做得好处就是可以
让用户根据自己需求来启用,也能让软件速度最大化。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.