简体   繁体   English

如何使用 pop 更新 gobuffalo 模型?

[英]How to update gobuffalo models with pop?

I'm starting a project and already check how useful is gobuffalo/pop.我正在开始一个项目并且已经检查 gobuffalo/pop 有多大用处。
I have never previously used a framework for my GO projects.我以前从未在我的 GO 项目中使用过框架。 I just used the stdlib and I'm used to working with Django too.我只是使用了stdlib而且我也习惯于使用 Django。

In Django it is pretty straight forward to create/update a model and generate its migrations.在 Django 中,创建/更新模型并生成其迁移非常简单。 It gets the current DjangoModel and generates a migration with the changes.它获取当前的 DjangoModel 并生成包含更改的迁移。 What a surprise to me when I can't find how to do it with pop.当我无法找到如何使用 pop 时,这让我感到惊讶。

I already checked the documentation but I couldn't find any examples.我已经检查了文档,但找不到任何示例。

How do you do that?你是怎样做的?

Right now, you can only generate empty migrations and write them yourself: https://gobuffalo.io/en/docs/db/migrations#writing-migrations目前只能生成空迁移并自己编写: https : //gobuffalo.io/en/docs/db/migrations#writing-migrations

There's an issue asking to implement a Django-like migrations generator ( https://github.com/gobuffalo/pop/issues/184 ), but it's not done yet and requires a lot of work.有一个问题要求实现一个类似 Django 的迁移生成器 ( https://github.com/gobuffalo/pop/issues/184 ),但它还没有完成,需要做很多工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM