basic workspace model and repository implementation
This commit is contained in:
37
alembic/versions/4be312655ceb_add_workspaces_table.py
Normal file
37
alembic/versions/4be312655ceb_add_workspaces_table.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""add workspaces table
|
||||
|
||||
Revision ID: 4be312655ceb
|
||||
Revises: 05d6272bdb43
|
||||
Create Date: 2018-08-16 09:25:19.888549
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4be312655ceb'
|
||||
down_revision = '05d6272bdb43'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('workspaces',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), server_default=sa.text('uuid_generate_v4()'), nullable=False),
|
||||
sa.Column('request_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('task_order_id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['request_id'], ['requests.id'], ),
|
||||
sa.ForeignKeyConstraint(['task_order_id'], ['task_order.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('workspaces')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user