Rename modified column to updated
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""rename modified to updated
|
||||
|
||||
Revision ID: 05f3ae5db7c7
|
||||
Revises: 970563653ece
|
||||
Create Date: 2020-07-22 23:56:38.694837
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "05f3ae5db7c7"
|
||||
down_revision = "970563653ece"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
tables = {
|
||||
"cities": "modified",
|
||||
"games": "modified",
|
||||
"payments": "modified",
|
||||
"player_availabilities": "modified",
|
||||
"player_cancel_games": "modified",
|
||||
"purchase_games": "modified",
|
||||
"sports": "modified",
|
||||
"teams": "modified",
|
||||
"user_ratings": "modified",
|
||||
"venues": "modified",
|
||||
}
|
||||
for table, field in tables.items():
|
||||
with op.batch_alter_table(table) as batch_op:
|
||||
batch_op.alter_column(column_name=field, new_column_name="updated")
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
@@ -20,7 +20,6 @@ def upgrade():
|
||||
tables = {
|
||||
"cities": "updated",
|
||||
"games": "updated",
|
||||
"games": "cancel_date",
|
||||
"payments": "updated",
|
||||
"player_availabilities": "updated",
|
||||
"player_cancel_games": "updated",
|
||||
|
||||
Reference in New Issue
Block a user