Remove TaskOrder.status column from database
This commit is contained in:
parent
53918f0593
commit
c8174bdc10
@ -0,0 +1,28 @@
|
|||||||
|
"""Remove status column from task order
|
||||||
|
|
||||||
|
Revision ID: da9d1c911a52
|
||||||
|
Revises: a6837632686c
|
||||||
|
Create Date: 2019-01-14 11:21:51.729134
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'da9d1c911a52'
|
||||||
|
down_revision = 'a6837632686c'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('task_orders', 'status')
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('task_orders', sa.Column('status', sa.VARCHAR(length=7), autoincrement=False, nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
@ -1,14 +1,6 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from sqlalchemy import (
|
from sqlalchemy import Column, Numeric, String, ForeignKey, Date, Integer
|
||||||
Column,
|
|
||||||
Enum as SQLAEnum,
|
|
||||||
Numeric,
|
|
||||||
String,
|
|
||||||
ForeignKey,
|
|
||||||
Date,
|
|
||||||
Integer,
|
|
||||||
)
|
|
||||||
from sqlalchemy.types import ARRAY
|
from sqlalchemy.types import ARRAY
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
@ -41,8 +33,6 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
|||||||
so_id = Column(ForeignKey("users.id"))
|
so_id = Column(ForeignKey("users.id"))
|
||||||
security_officer = relationship("User", foreign_keys="TaskOrder.so_id")
|
security_officer = relationship("User", foreign_keys="TaskOrder.so_id")
|
||||||
|
|
||||||
status = Column(SQLAEnum(Status, native_enum=False))
|
|
||||||
|
|
||||||
scope = Column(String) # Cloud Project Scope
|
scope = Column(String) # Cloud Project Scope
|
||||||
defense_component = Column(String) # Department of Defense Component
|
defense_component = Column(String) # Department of Defense Component
|
||||||
app_migration = Column(String) # App Migration
|
app_migration = Column(String) # App Migration
|
||||||
@ -79,10 +69,9 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
|||||||
number = Column(String, unique=True) # Task Order Number
|
number = Column(String, unique=True) # Task Order Number
|
||||||
loa = Column(ARRAY(String)) # Line of Accounting (LOA)
|
loa = Column(ARRAY(String)) # Line of Accounting (LOA)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
@property
|
||||||
super().__init__(*args, **kwargs)
|
def status(self):
|
||||||
if "status" not in kwargs:
|
return Status.PENDING
|
||||||
self.status = Status.PENDING
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def budget(self):
|
def budget(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user