Comments (7)
去掉后,写入的时候不带 pk 是会报错的啊,这是出于什么目的?
from mysql-schema-sync.
可能是我没表达清楚
比如:
CREATE TABLE t1
(
id
int(11) NOT NULL AUTO_INCREMENT,
name
varchar(100) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=1065290 DEFAULT CHARSET=utf8mb4;
把 AUTO_INCREMENT=1065290 去掉 或者替换为 AUTO_INCREMENT=1
变成:
CREATE TABLE t1
(
id
int(11) NOT NULL AUTO_INCREMENT,
name
varchar(100) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
或者在建表语句后,加一句:
alter table t1 AUTO_INCREMENT=1
这样改动可能更容易实现
from mysql-schema-sync.
ok 明白,就是创建新表的时候,重置 AUTO_INCREMENT 的值。
需求和功能合理,欢迎提交 pr。
from mysql-schema-sync.
感谢回复~
from mysql-schema-sync.
20220311.2 , 使用这个版本,好像没有去掉
from mysql-schema-sync.
我测试是已经去掉了,把新表的 schema 的最后一行贴一下?
from mysql-schema-sync.
ENGINE=InnoDB AUTO_INCREMENT=4049116 DEFAULT CHARSET=utf8mb4;
from mysql-schema-sync.
Related Issues (20)
- 能不能讲下原理 HOT 1
- 表同步有问题,
- 比对成功,且生成的sql 都是对的,但没有执行(命令参数是配置正确的)
- 生成的DDL字段顺序没有考虑 HOT 1
- 目标多了一些表,但同步的时候没有和源保持同步,没有删除目标多余的表 HOT 1
- 问题 HOT 4
- can't load package: package github.com/hidu/mysql-schema-sync@latest: can only use path@version syntax with 'go get' HOT 1
- 生成的sql没有db名,只有table名,希望加下,谢谢 HOT 1
- config.json中密码有特殊字符‘@’,请教怎么转义啊 HOT 7
- 是否增加多数据库或者多数据源支持
- 如何能不删除目的数据库中多出来的表 HOT 4
- 无法通过go install 安装 HOT 1
- 25端口邮箱发送报错 HOT 2
- 新创建表的 SQL 没有去掉 AUTO_INCREMENT=xxx
- -single_schema_change 会生成多份相同的sql HOT 2
- 如何同步多个数据库,可以指定数据库名称前缀,同步到 test_1,test_2,test_2 HOT 1
- 导出数据带索引方法,可以忽略吗 HOT 1
- 能否增加新的参数,可以让用户指定 字符集的 COLLATE HOT 1
- mail send fail EOF
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql-schema-sync.