mirror of
https://github.com/flibusta-apps/services_manager_server.git
synced 2025-12-06 20:45:37 +01:00
Add privileged field
This commit is contained in:
28
src/app/alembic/versions/738a796c3f0a_.py
Normal file
28
src/app/alembic/versions/738a796c3f0a_.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: 738a796c3f0a
|
||||||
|
Revises: 7a76c257df70
|
||||||
|
Create Date: 2021-12-13 01:34:21.957994
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '738a796c3f0a'
|
||||||
|
down_revision = '7a76c257df70'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('services', sa.Column('privileged', sa.Boolean(), server_default='f', nullable=False))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('services', 'privileged')
|
||||||
|
# ### end Alembic commands ###
|
||||||
@@ -25,4 +25,5 @@ class Service(ormar.Model):
|
|||||||
token: str = ormar.String(max_length=128, unique=True) # type: ignore
|
token: str = ormar.String(max_length=128, unique=True) # type: ignore
|
||||||
user: int = ormar.BigInteger() # type: ignore
|
user: int = ormar.BigInteger() # type: ignore
|
||||||
status: str = ormar.String(max_length=12, choices=list(Statuses), default=Statuses.pending) # type: ignore
|
status: str = ormar.String(max_length=12, choices=list(Statuses), default=Statuses.pending) # type: ignore
|
||||||
|
privileged: bool = ormar.Boolean(default=False, server_default='f', nullable=False) # type: ignore
|
||||||
created_time = ormar.DateTime(timezone=True, default=datetime.now)
|
created_time = ormar.DateTime(timezone=True, default=datetime.now)
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ class ServiceDetail(BaseModel):
|
|||||||
token: str
|
token: str
|
||||||
user: str
|
user: str
|
||||||
status: str
|
status: str
|
||||||
|
privileged: bool
|
||||||
created_time: datetime
|
created_time: datetime
|
||||||
|
|||||||
Reference in New Issue
Block a user