-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webhook_history stores UNIX timestamps instead of DateTime
- Loading branch information
Showing
5 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
.../coprs_frontend/alembic/versions/bb52d9f878f5_change_webhook_history_timestamp_column_.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,26 @@ | ||
""" | ||
Change Webhook History timestamp column type from DateTime to Integer UNIX timestamp | ||
Revision ID: bb52d9f878f5 | ||
Create Date: 2024-09-19 18:07:28.504280 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.sql import func | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'bb52d9f878f5' | ||
down_revision = '06b208e317a3' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column('webhook_history', sa.Column('created_on', sa.Integer(), nullable=True)) | ||
op.drop_column('webhook_history', 'timestamp') | ||
|
||
def downgrade(): | ||
op.add_column('webhook_history', sa.Column('timestamp', sa.DateTime(timezone=True), server_default=func.now())) | ||
op.drop_column('webhook_history', 'created_on') |
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
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
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
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