-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/tkalir/anyway into 2581-send…
…_to_telegram_after_verified_location
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
alembic/versions/11ddb0cff075_adding_location_verification_role.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,45 @@ | ||
"""adding location verification role | ||
Revision ID: 11ddb0cff075 | ||
Revises: fe08b885a23f | ||
Create Date: 2024-04-21 06:18:03.777200 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '11ddb0cff075' | ||
down_revision = 'fe08b885a23f' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import orm | ||
import datetime | ||
|
||
|
||
def upgrade(): | ||
from anyway.models import Roles | ||
|
||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
|
||
role_location_verification = Roles( | ||
name="location_verification", | ||
description="Allows user to change and verify newsflash location.", | ||
create_date=datetime.datetime.now(), | ||
) | ||
session.add(role_location_verification) | ||
session.commit() | ||
|
||
|
||
def downgrade(): | ||
from anyway.models import Roles | ||
|
||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
|
||
# Delete the role added in the upgrade | ||
session.query(Roles).filter(Roles.name == "location_verification").delete() | ||
|
||
session.commit() |
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