Giter Site home page Giter Site logo

Comments (7)

hidu avatar hidu commented on August 19, 2024

去掉后,写入的时候不带 pk 是会报错的啊,这是出于什么目的?

from mysql-schema-sync.

Urnotprepared avatar Urnotprepared commented on August 19, 2024

可能是我没表达清楚
比如:
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.

hidu avatar hidu commented on August 19, 2024

ok 明白,就是创建新表的时候,重置 AUTO_INCREMENT 的值。
需求和功能合理,欢迎提交 pr。

from mysql-schema-sync.

Urnotprepared avatar Urnotprepared commented on August 19, 2024

感谢回复~

from mysql-schema-sync.

Urnotprepared avatar Urnotprepared commented on August 19, 2024

20220311.2 , 使用这个版本,好像没有去掉

from mysql-schema-sync.

hidu avatar hidu commented on August 19, 2024

我测试是已经去掉了,把新表的 schema 的最后一行贴一下?

from mysql-schema-sync.

Urnotprepared avatar Urnotprepared commented on August 19, 2024

ENGINE=InnoDB AUTO_INCREMENT=4049116 DEFAULT CHARSET=utf8mb4;

from mysql-schema-sync.

Related Issues (20)

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.