Comments (5)
如果你的建表语句OK的话, 问题可能是这样的:
Mysql 5.6以上的版本不支持隐式默认值,
如需要兼容 你可以尝试:
explicit_defaults_for_timestamp=0
但你启动mysql时可能会再log 里看到一些warning,
需后续开发成员对程序进行一些更新,不要传递nil 即可
from fe.
在my.cnf配置文件[mysqld]节中设置:
explicit_defaults_for_timestamp= 0
重启mysql即可。
from fe.
你的建表语句有问题:https://github.com/open-falcon/scripts/blob/master/db_schema/uic-db-schema.sql#L11 这个是有default值的,所以不会出错才对
from fe.
1、修改文件fe/http/uic/user_controller.go
import (
...
"time" //新增
)
func (this *UserController) CreateRoot() {
...
userPtr := &User{
Created: time.Now(), //新增
}
...
}
重新control build 可以設置 fe 的 root 帳號的密碼為 abc
2、修改文件fe/model/uic/user.go
func InsertRegisterUser(name, password string) (int64, error) {
userPtr := &User{
Name: name,
Passwd: password,
Created: time.Now(),//新增
}
return userPtr.Save()
}
重新control build 可以註冊普通用戶
3、修改文件fe/model/uic/team.go
func SaveTeamAttrs(name, resume string, creator int64) (int64, error) {
//t := &Team{Name: name, Resume: resume, Creator: creator}
t := &Team{Name: name, Resume: resume, Creator: creator,Created:time.Now()} //修改为此
return t.Save()
}
重新control build 可以增加用户组
from fe.
@itchenyi
mysql> set explicit_defaults_for_timestamp=0 ;
ERROR 1238 (HY000): Variable 'explicit_defaults_for_timestamp' is a read only variable
from fe.
Related Issues (8)
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 fe.