1
# Copyright (C) 2015 by the Free Software Foundation, Inc.
3
# This file is part of GNU Mailman.
5
# GNU Mailman is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 3 of the License, or (at your option)
10
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
# You should have received a copy of the GNU General Public License along with
16
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18
"""add_serverowner_domainowner
20
Revision ID: 46e92facee7
22
Create Date: 2015-03-20 16:01:25.007242
26
# Revision identifiers, used by Alembic.
27
revision = '46e92facee7'
28
down_revision = '33e1f5f6fa8'
30
from alembic import op
31
import sqlalchemy as sa
37
sa.Column('user_id', sa.Integer(), nullable=False),
38
sa.Column('domain_id', sa.Integer(), nullable=False),
39
sa.ForeignKeyConstraint(['domain_id'], ['domain.id'], ),
40
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
41
sa.PrimaryKeyConstraint('user_id', 'domain_id')
45
sa.Column('is_server_owner', sa.Boolean(), nullable=True))
46
if op.get_bind().dialect.name != 'sqlite':
47
op.drop_column('domain', 'contact_address')
51
if op.get_bind().dialect.name != 'sqlite':
52
op.drop_column('user', 'is_server_owner')
55
sa.Column('contact_address', sa.VARCHAR(), nullable=True))
56
op.drop_table('domain_owner')