Coder Social home page Coder Social logo

mysql 依赖降级 about apollo HOT 11 CLOSED

apolloconfig avatar apolloconfig commented on May 22, 2024
mysql 依赖降级

from apollo.

Comments (11)

nobodyiam avatar nobodyiam commented on May 22, 2024 5

应该是不需要的,可以试一下把所有的DataChange_CreatedTime字段上的DEFAULT CURRENT_TIMESTAMP COMMENT改为DEFAULT '2000-01-01 00:00:00'。

代码上看,创建时间都会被程序设置的。

@PrePersist
protected void prePersist() {
    if (this.dataChangeCreatedTime == null) dataChangeCreatedTime = new Date();
    if (this.dataChangeLastModifiedTime == null) dataChangeLastModifiedTime = new Date();
}

from apollo.

secwang avatar secwang commented on May 22, 2024 3

可行,附上我的更改脚本。

cd ~/apollo-build-scripts/sql
 perl -pi -e 's/\`DataChange_CreatedTime\` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP/\`DataChange_CreatedTime\` timestamp NOT NULL DEFAULT \'2000-01-01 00:00:00\'/g' *

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024 1

目前来看,主要是用到了两个高级特性:

  1. utf8mb4 - 这个需要5.5版本以上
  2. 一张表有多个timestamp的default值 - 这个需要5.6.5以上

所以,理论上而言,使用5.5.40也是可以的,修改一下建表语句就可以了。
把一张表中多个timestamp的default值去掉一个就可以了,代码里面应该都会设置默认值的。

from apollo.

secwang avatar secwang commented on May 22, 2024

utf8mb4这个没问题,timestamp 这个问题我,确认下,需要代码patch么

from apollo.

secwang avatar secwang commented on May 22, 2024

我实验下

from apollo.

secwang avatar secwang commented on May 22, 2024

5.5 还存在 fulltext key 不支持 innodb 的问题,需要改为key

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

@secwang PR143把fulltext key改为key了。

from apollo.

secwang avatar secwang commented on May 22, 2024

哈哈,感谢

from apollo.

lyg123 avatar lyg123 commented on May 22, 2024

@nobodyiam
DEFAULT CURRENT_TIMESTAMP 改成 DEFAULT '2000-01-01 00:00:00' 吧?
我看你的有COMMENT。

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

@lyg123 comment无所谓的

from apollo.

pgssb avatar pgssb commented on May 22, 2024

我刚刚升级了

from apollo.

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.