]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Added parameters if_exists and if_not_exists for index operations.
authorАдриан Максим Александрович <adrian@tochka.com>
Tue, 11 Jul 2023 19:31:29 +0000 (15:31 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 11 Jul 2023 20:27:15 +0000 (22:27 +0200)
commit88db76eb66bb4393dffb5384ee649afe02020a46
tree93eb27b15a6969eff1c2a9d442ac06c26fa77962
parentf5e7fd6d72e0a4c61bb72e691d0e0acfb6c594de
Added parameters if_exists and if_not_exists for index operations.

Fixes: #151
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

As mentioned in #151, IF EXISTS/IF NOT EXISTS syntax was implemented in SQLAlchemy 2.0. This request adds an ability to use them for index operations.

If the issue implies to implement all the possible cases with these directives, I could continue working on it 🙂

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] 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: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [x] 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: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1260
Pull-request: https://github.com/sqlalchemy/alembic/pull/1260
Pull-request-sha: 5ed62d17c349dc175521993c5a62b842f6ac624d

Change-Id: Ic0fec21e20d4a868e9e29275e540f3e09918d1ff
alembic/ddl/impl.py
alembic/ddl/mssql.py
alembic/ddl/postgresql.py
alembic/op.pyi
alembic/operations/base.py
alembic/operations/batch.py
alembic/operations/ops.py
alembic/operations/toimpl.py
docs/build/unreleased/151.rst [new file with mode: 0644]
tests/test_op.py
tests/test_postgresql.py