Blame migrations/versions/5948e1b95495_.py

d98009ae1961
"""
d98009ae1961
Add organisation logos and branding CSS.
d98009ae1961
d98009ae1961
Revision ID: 5948e1b95495
d98009ae1961
Revises: c576636d1bfe
d98009ae1961
Create Date: 2017-06-06 18:03:49.197275
d98009ae1961
d98009ae1961
"""
d98009ae1961
d98009ae1961
# revision identifiers, used by Alembic.
d98009ae1961
revision = '5948e1b95495'
d98009ae1961
down_revision = 'c576636d1bfe'
d98009ae1961
d98009ae1961
from alembic import op
d98009ae1961
import sqlalchemy as sa
d98009ae1961
d98009ae1961
d98009ae1961
def upgrade():
d98009ae1961
    op.create_table('organisation_branding',
d98009ae1961
                    sa.Column('id', sa.Integer(), nullable=False),
d98009ae1961
                    sa.Column('enabled', sa.Boolean(),
d98009ae1961
                              server_default=sa.text('false'), nullable=False),
d98009ae1961
                    sa.Column('organisation_id', sa.Integer(), nullable=False),
d98009ae1961
                    sa.Column('logo_id', sa.Integer(), nullable=True),
d98009ae1961
                    sa.Column('theme', sa.String(), nullable=True),
d98009ae1961
                    sa.Column('custom_css_id', sa.Integer(), nullable=True),
d98009ae1961
                    sa.ForeignKeyConstraint(['custom_css_id'],
d98009ae1961
                                            ['documentfile.id'], ),
d98009ae1961
                    sa.ForeignKeyConstraint(['logo_id'],
d98009ae1961
                                            ['documentfile.id'], ),
d98009ae1961
                    sa.ForeignKeyConstraint(['organisation_id'],
d98009ae1961
                                            ['organisation.id'], ),
d98009ae1961
                    sa.PrimaryKeyConstraint('id'))
d98009ae1961
d98009ae1961
d98009ae1961
def downgrade():
d98009ae1961
    op.drop_table('organisation_branding')