dongpalou5352 2015-05-12 07:30
浏览 568

如何使用Beego框架进行数据库迁移?

I need to add a new field to existing table, what is the correct process to do this with Beego?

I am familiar with Django's south: first you generate the migration script with manage.py schema_migration, then execute the migration script manage.py migrate.

Beego has a command bee generate migration to generate migration script in database/migrations/xxx.go. But I don't understand how to use this generated script, it doesn't seem to be connected with anything.

And I don't see any documentation mentioning migration.

  • 写回答

3条回答 默认 最新

  • drkwpgrdb092239314 2015-10-08 09:23
    关注

    I think you also need to add in migration file beego. Then, bee migrate -driver='mysql' -conn='root:@tcp(127.0.0.1:3306)/test'

    评论

报告相同问题?

悬赏问题

  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?