Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The station branch was older than when I made added_at mandatory, but was merged later.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...axi_models2/migrations/versions/20230208_13:32:21_861188cd0769_station_added_at_update.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,28 @@ | ||
"""station.added_at update | ||
Revision ID: 861188cd0769 | ||
Revises: ed669e53e432 | ||
Create Date: 2023-02-08 13:32:21.599609 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '861188cd0769' | ||
down_revision = 'ed669e53e432' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.alter_column('station', 'added_at', | ||
existing_type=postgresql.TIMESTAMP(), | ||
nullable=False) | ||
|
||
|
||
def downgrade(): | ||
op.alter_column('station', 'added_at', | ||
existing_type=postgresql.TIMESTAMP(), | ||
nullable=True) |