mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Add Organisation model and migration
Now that we have renamed the 'old' organisation model to email_branding, we can create a new organisation model.
This commit is contained in:
34
migrations/versions/0163_add_new_org_model.py
Normal file
34
migrations/versions/0163_add_new_org_model.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0163_add_new_org_model
|
||||
Revises: 0162_remove_org
|
||||
Create Date: 2018-02-07 14:03:00.804849
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0163_add_new_org_model'
|
||||
down_revision = '0162_remove_org'
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('organisation',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=False),
|
||||
sa.Column('active', sa.Boolean(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_organisation_name'), 'organisation', ['name'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_organisation_name'), table_name='organisation')
|
||||
op.drop_table('organisation')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user