This repository has been archived on 2022-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
it-volunteers-for-peace/alembic/versions/2450600b8eaf_add_project_contacts.py
2022-10-17 14:35:05 +03:00

33 lines
667 B
Python

"""add project contacts
Revision ID: 2450600b8eaf
Revises: 9b42b5289e30
Create Date: 2022-10-17 12:46:59.115251
"""
from alembic import op
from sqlalchemy.sql import text
# revision identifiers, used by Alembic.
revision = '2450600b8eaf'
down_revision = '9b42b5289e30'
branch_labels = None
depends_on = None
def upgrade() -> None:
conn = op.get_bind()
add_contacts_query = "ALTER TABLE projects ADD COLUMN contacts varchar(50)"
conn.execute(text(add_contacts_query))
def downgrade() -> None:
conn = op.get_bind()
drop_contacts_query = """
ALTER TABLE projects DROP COLUMN contacts
"""
conn.execute(text(drop_contacts_query))