Add cloud_id column to environment model
When an environment is created, we'll need to create something in the CSP and keep track of the ID of the created thing.
This commit is contained in:
parent
5988f20dff
commit
2dba02e03c
@ -0,0 +1,28 @@
|
|||||||
|
"""Add cloud_id column to environments
|
||||||
|
|
||||||
|
Revision ID: b3fa1493e0a9
|
||||||
|
Revises: 6172ac7b8b26
|
||||||
|
Create Date: 2019-01-04 14:28:59.660309
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'b3fa1493e0a9'
|
||||||
|
down_revision = '6172ac7b8b26'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('environments', sa.Column('cloud_id', sa.String(), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('environments', 'cloud_id')
|
||||||
|
# ### end Alembic commands ###
|
@ -15,6 +15,8 @@ class Environment(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
project_id = Column(ForeignKey("projects.id"), nullable=False)
|
project_id = Column(ForeignKey("projects.id"), nullable=False)
|
||||||
project = relationship("Project")
|
project = relationship("Project")
|
||||||
|
|
||||||
|
cloud_id = Column(String)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def users(self):
|
def users(self):
|
||||||
return [r.user for r in self.roles]
|
return [r.user for r in self.roles]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user