one thing to note with "empty" migrations is that autogenerate does
not pick up things like changes of server default or datatypes unless
you set some flags to turn it on,
https://alembic.sqlalchemy.org/en/latest/api/runtime.html?highlight=compare_server_default#alembic.runtime.environment.EnvironmentContext.configure.params.compare_server_default
 
https://alembic.sqlalchemy.org/en/latest/api/runtime.html?#alembic.runtime.environment.EnvironmentContext.configure.params.compare_type

so keeping that in mind, if you want to skip generating empty
migrations, use the recipe at:
https://alembic.sqlalchemy.org/en/latest/cookbook.html#don-t-generate-empty-migrations-with-autogenerate


On Fri, Jan 11, 2019 at 4:33 AM <jackadam1...@gmail.com> wrote:
>
> Can I ignore it when the result of the generation is empty?
> I use it in docker, there is a startup command to upgrade the database 
> version to the latest.
> The database version is updated at startup and a record update version_num is 
> generated.
> Sorry for my bad English
>
> from alembic import op
> import sqlalchemy as sa
>
>
> # revision identifiers, used by Alembic.
> revision = 'c9bc72b06651'
> down_revision = '713561aabb78'
> branch_labels = None
> depends_on = None
>
>
> def upgrade():
>     # ### commands auto generated by Alembic - please adjust! ###
>     pass
>     # ### end Alembic commands ###
>
>
> def downgrade():
>     # ### commands auto generated by Alembic - please adjust! ###
>     pass
>     # ### end Alembic commands ###
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy-alembic+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to