diff --git a/make/migrations/postgresql/0004_add_robot_account.up.sql b/make/migrations/postgresql/0004_add_robot_account.up.sql index c97f6af0a..8255b3788 100644 --- a/make/migrations/postgresql/0004_add_robot_account.up.sql +++ b/make/migrations/postgresql/0004_add_robot_account.up.sql @@ -1,7 +1,10 @@ -create table robot ( +CREATE TABLE robot ( id SERIAL PRIMARY KEY NOT NULL, name varchar(255), - token varchar(4096), + /* + The maximum length of token is 7k +*/ + token varchar(7168), description varchar(1024), project_id int, disabled boolean DEFAULT false NOT NULL, diff --git a/src/common/models/robot.go b/src/common/models/robot.go index c6d2fb6e5..202089dec 100644 --- a/src/common/models/robot.go +++ b/src/common/models/robot.go @@ -23,7 +23,7 @@ const RobotTable = "robot" // Robot holds the details of a robot. type Robot struct { - ID int `orm:"pk;auto;column(id)" json:"id"` + ID int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"column(name)" json:"name"` Token string `orm:"column(token)" json:"token"` Description string `orm:"column(description)" json:"description"`