forked from PnX-SI/GeoNature
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(db): add observers_txt column to t_base_visit
Add revision alembic Reviewed-by: andriacap
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
backend/geonature/migrations/versions/8309591841f3_add_observers_txt_column_t_base_visit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""add_observers_txt_column_t_base_visit | ||
Revision ID: 8309591841f3 | ||
Revises: f1dd984bff97 | ||
Create Date: 2023-10-06 11:07:43.532623 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "8309591841f3" | ||
down_revision = "f1dd984bff97" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
monitorings_schema = "gn_monitoring" | ||
table = "t_base_visits" | ||
column = "observers_txt" | ||
|
||
|
||
def upgrade(): | ||
op.add_column( | ||
table, | ||
sa.Column( | ||
column, | ||
sa.Text(), | ||
nullable=True, | ||
), | ||
schema=monitorings_schema, | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column(table, column, schema=monitorings_schema) |