
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
alembic-autogenerate-enums
Advanced tools
Alembic hook that allows enums values to be upgraded and downgraded in migrations automatically
This package implements an Alembic hook that causes alembic revision --autogenerate
to output PostgreSQL ALTER TYPE .. ADD VALUE
SQL
statements as part of new migrations.
Add the line:
import alembic_autogenerate_enums
To the top of your env.py
.
Since ALTER TYPE .. ADD VALUE
cannot run transactionally, each
op.sync_enum_values()
call creates its own temporary private DB connection.
See https://bitbucket.org/zzzeek/alembic/issues/123/a-way-to-run-non-transactional-ddl
We have incredibly basic tests in a sample project.
mkvirtualenv alembic-autogenerate
Install the main autogenerate package and then the test harness:
pip install -e .
pip install -e test-harness
createuser alembic-autogenerate
createdb -O alembic-autogenerate alembic-autogenerate_db
cd test-harness && pytest
FAQs
Alembic hook that allows enums values to be upgraded and downgraded in migrations automatically
We found that alembic-autogenerate-enums demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.