mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
🩹 — Check before adding/removing ip_version_enum
This commit is contained in:
parent
64f8241e74
commit
586660c02a
2 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- 🩹 — Avoid warning from MySQL only alembic instructions
|
- 🩹 — Avoid warning from MySQL only alembic instructions
|
||||||
|
- 🩹 — Check before adding/removing ip_version_enum
|
||||||
|
|
||||||
|
|
||||||
## 0.7.0
|
## 0.7.0
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
enum = ENUM("4", "6", name="ip_version_enum", create_type=False)
|
enum = ENUM("4", "6", name="ip_version_enum", create_type=False)
|
||||||
enum.create(op.get_bind(), checkfirst=False)
|
enum.create(op.get_bind(), checkfirst=True)
|
||||||
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
||||||
batch_op.add_column(
|
batch_op.add_column(
|
||||||
sa.Column("ip_version", enum, server_default="4", nullable=False)
|
sa.Column("ip_version", enum, server_default="4", nullable=False)
|
||||||
|
@ -31,4 +31,4 @@ def upgrade() -> None:
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
with op.batch_alter_table("tasks", schema=None) as batch_op:
|
||||||
batch_op.drop_column("ip_version")
|
batch_op.drop_column("ip_version")
|
||||||
ENUM(name="ip_version_enum").drop(op.get_bind(), checkfirst=False)
|
ENUM(name="ip_version_enum").drop(op.get_bind(), checkfirst=True)
|
||||||
|
|
Loading…
Reference in a new issue