cloudspannerecosystem / wrench

wrench - Schema management tool for Cloud Spanner -
MIT License
238 stars 47 forks source link

Docs: Is there a recommend way to use wrench with https://github.com/cloudspannerecosystem/yo? #115

Closed jferrl closed 2 months ago

jferrl commented 2 months ago

WHAT

I would like to know if there is recommended way of working with wrench when you are generating DB models using yo

WHY

I have a proyect where the db models are generated using yo. My idea is start using wrench for managing schema migrations. In this case, yo, is using schema.sql to generate models. If i start using migrations, what is the good way to generate models?

shuheiktgw commented 2 months ago

If you're using schema.sql to generate models with yo, start by running wrench migrate up --directory ./[Migration Directory] locally to execute the migration. Next, run wrench load --directory ./[Migration Directory] to update the schema.sql file in the [Migration Directory]. After these steps, you can use the updated [Migration Directory]/schema.sqlto generate the models with yo 🙂

jferrl commented 2 months ago

Thanks! 😄