diff --git a/.travis.yml b/.travis.yml index 79be997af..4b204162e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,8 @@ before_install: install: - sudo apt-get update && sudo apt-get install -y libldap2-dev - sudo apt-get remove -y mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5 - - sudo apt-get autoremove - - sudo apt-get install libaio1 + - sudo apt-get autoremove -y + - sudo apt-get install -y libaio1 - wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/ - sudo dpkg -i mysql-5.6.14.deb - sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server diff --git a/models/accesslog.go b/models/accesslog.go index 336e7bd08..defc7e37d 100644 --- a/models/accesslog.go +++ b/models/accesslog.go @@ -21,7 +21,7 @@ import ( // AccessLog holds information about logs which are used to record the actions that user take to the resourses. type AccessLog struct { - LogID int `orm:"column(log_id)" json:"log_id"` + LogID int `orm:"pk;column(log_id)" json:"log_id"` UserID int `orm:"column(user_id)" json:"user_id"` ProjectID int64 `orm:"column(project_id)" json:"project_id"` RepoName string `orm:"column(repo_name)" json:"repo_name"` diff --git a/models/project.go b/models/project.go index 7f5d54c25..e16f0ce5f 100644 --- a/models/project.go +++ b/models/project.go @@ -21,7 +21,7 @@ import ( // Project holds the details of a project. type Project struct { - ProjectID int64 `orm:"column(project_id)" json:"project_id"` + ProjectID int64 `orm:"pk;column(project_id)" json:"project_id"` OwnerID int `orm:"column(owner_id)" json:"owner_id"` Name string `orm:"column(name)" json:"name"` CreationTime time.Time `orm:"column(creation_time)" json:"creation_time"` diff --git a/models/user.go b/models/user.go index 241a25549..1b8b2ae86 100644 --- a/models/user.go +++ b/models/user.go @@ -21,7 +21,7 @@ import ( // User holds the details of a user. type User struct { - UserID int `orm:"column(user_id)" json:"user_id"` + UserID int `orm:"pk;column(user_id)" json:"user_id"` Username string `orm:"column(username)" json:"username"` Email string `orm:"column(email)" json:"email"` Password string `orm:"column(password)" json:"password"`