level12 / keg-app-cookiecutter

0 stars 0 forks source link

Add alembic migration for initial models #37

Closed tjlevel12 closed 5 years ago

tjlevel12 commented 6 years ago

The cookiecutter includes three example models (Blog, Comment, and User), but no matching alembic migration files.

A migration for the User model, at least, would be a handy addition to the cookiecutter.

rsyring commented 6 years ago

@tjlevel12 I was thinking about this and I'm not sure it makes sense to have a migration for the User. For the initial deploy, you should be able to just do:

https://github.com/level12/keg-app-cookiecutter/blob/0f5101e8544abbaa17cf9624009a3be706e7e270/%7B%7Bcookiecutter.project_dashed%7D%7D-src/readme.rst#L73

The first_run argument to deploy will create your DB as it's setup in the entities. After that, you will need migrations, but "after that" is beyond the scope of this cookie cutter. :)

Let me know if you had something else in mind or if I'm missing something here.

Thanks.

nZac commented 5 years ago

I am going to close this @tjlevel12. By including migrations for the keg-auth library into this cookiecutter we would have to ensure that the migration is kept up to date with any model changes in keg-auth.

Instead, I suggest running alembic revision --autogenerate -m "Create Initial Migrations for Keg-Auth after you have setup your initial model and it will generate the correct migrations for you.