From: Sebastian Bayer Date: Wed, 25 Oct 2023 13:26:51 +0000 (-0400) Subject: Update of the no-empty-migrations snippet to work with alembic check X-Git-Tag: rel_1_12_1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20a04c11e8715fc10449e98d3e025734ca7de1d6;p=thirdparty%2Fsqlalchemy%2Falembic.git Update of the no-empty-migrations snippet to work with alembic check ### Description Update of the no-empty-migrations snippet to work with alembic check, see https://github.com/sqlalchemy/alembic/discussions/1332 ### Checklist This pull request is: - [ x] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #` in the commit message - please include tests. **Have a nice day!** Closes: #1338 Pull-request: https://github.com/sqlalchemy/alembic/pull/1338 Pull-request-sha: eeb7cdab9559b0500be8f1543fad97f5305f2b0f Change-Id: Ic23efda1fc33686605ccd07437afc057cfc98574 --- diff --git a/docs/build/cookbook.rst b/docs/build/cookbook.rst index f5cf6cbb..cde13914 100644 --- a/docs/build/cookbook.rst +++ b/docs/build/cookbook.rst @@ -917,7 +917,7 @@ any operations:: directives: list[MigrationScript], ): assert config.cmd_opts is not None - if config.cmd_opts.autogenerate: + if getattr(config.cmd_opts, 'autogenerate', False): script = directives[0] assert script.upgrade_ops is not None if script.upgrade_ops.is_empty():