{"action":"closed","issue":{"url":"https://api.github.com/repos/astaxie/beego/issues/1017","repository_url":"https://api.github.com/repos/astaxie/beego","labels_url":"https://api.github.com/repos/astaxie/beego/issues/1017/labels{/name}","comments_url":"https://api.github.com/repos/astaxie/beego/issues/1017/comments","events_url":"https://api.github.com/repos/astaxie/beego/issues/1017/events","html_url":"https://github.com/astaxie/beego/issues/1017","id":55726760,"number":1017,"title":"Beego ORM doesn't support default for PostgreSQL","user":{"login":"owentran","id":1973536,"avatar_url":"https://avatars.githubusercontent.com/u/1973536?v=3","gravatar_id":"","url":"https://api.github.com/users/owentran","html_url":"https://github.com/owentran","followers_url":"https://api.github.com/users/owentran/followers","following_url":"https://api.github.com/users/owentran/following{/other_user}","gists_url":"https://api.github.com/users/owentran/gists{/gist_id}","starred_url":"https://api.github.com/users/owentran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owentran/subscriptions","organizations_url":"https://api.github.com/users/owentran/orgs","repos_url":"https://api.github.com/users/owentran/repos","events_url":"https://api.github.com/users/owentran/events{/privacy}","received_events_url":"https://api.github.com/users/owentran/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2015-01-28T08:20:45Z","updated_at":"2016-08-18T17:18:32Z","closed_at":"2016-08-18T17:18:32Z","body":"According to the docs... http://beego.me/docs/mvc/model/models.md you should be able to define a default value for a columns like so...\r\n\r\n```\r\ntype User struct {\r\n    ...\r\n    Status int `orm:\"default(1)\"`\r\n    ...\r\n}\r\n```\r\n\r\nHowever, all that does is add a column called status that is not null, but has no default...\r\n\r\n```\r\ntable `users` already exists, skip\r\nadd column `.../beego/models.User.Status` for table `users`\r\n    ALTER TABLE \"users\" ADD COLUMN \"status\" integer NOT NULL\r\n```\r\n\r\nIs default not supported anymore? There doesn't seem to be any commits to the ORM project for 5 months. Do you recommend a different ORM?\r\n\r\nA workaround for now is just to add the defaults to the column with SQL commands.\r\n"}}
{"actor":{"display_login":"astaxie"}}