{"action":"reopened","issue":{"url":"https://api.github.com/repos/eggjs/egg/issues/1538","repository_url":"https://api.github.com/repos/eggjs/egg","labels_url":"https://api.github.com/repos/eggjs/egg/issues/1538/labels{/name}","comments_url":"https://api.github.com/repos/eggjs/egg/issues/1538/comments","events_url":"https://api.github.com/repos/eggjs/egg/issues/1538/events","html_url":"https://github.com/eggjs/egg/issues/1538","id":265977043,"number":1538,"title":"使用egg-sequelize的时候，如何写model和migrate？","user":{"login":"njleonzhang","id":13174059,"avatar_url":"https://avatars1.githubusercontent.com/u/13174059?v=4","gravatar_id":"","url":"https://api.github.com/users/njleonzhang","html_url":"https://github.com/njleonzhang","followers_url":"https://api.github.com/users/njleonzhang/followers","following_url":"https://api.github.com/users/njleonzhang/following{/other_user}","gists_url":"https://api.github.com/users/njleonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/njleonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njleonzhang/subscriptions","organizations_url":"https://api.github.com/users/njleonzhang/orgs","repos_url":"https://api.github.com/users/njleonzhang/repos","events_url":"https://api.github.com/users/njleonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/njleonzhang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-10-17T02:55:53Z","updated_at":"2017-10-18T00:11:30Z","closed_at":null,"author_association":"NONE","body":"按目前文档的意思，建立一个数据库表的过程应该是：\r\n1. 先写model\r\n2. 用命令`npm run migrate:new`来创建一个migrate文件\r\n3. 在migrate文件里写migrate的逻辑\r\n\r\nmigrate里创建表的代码和model里的定义代码是一样的，岂不是repeat yourself了么。\r\n\r\n但是这几步，用`sequelize`的model:generate命令是一步生成出来的，你们为什么不也用生成的方式做呢？为什么推荐手写？是觉得生成的代码不好么？"}}
{"actor":{"display_login":"atian25"}}