diff options
| author | Barry Warsaw | 2015-04-06 16:07:04 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-04-06 16:07:04 -0400 |
| commit | f17be16aeac385854ca9693626027dbd553c2944 (patch) | |
| tree | 1eb6be6826b99159eb7325895347aca8ef8a44b1 /src/mailman/database | |
| parent | b0a841d634ad5a44b44af17548636e17c38541f1 (diff) | |
| parent | 17fa7ac10ddd6ca0916cdcdd3a5e8c1414e9bcbc (diff) | |
| download | mailman-f17be16aeac385854ca9693626027dbd553c2944.tar.gz mailman-f17be16aeac385854ca9693626027dbd553c2944.tar.zst mailman-f17be16aeac385854ca9693626027dbd553c2944.zip | |
Abhilash's branch, pre-cleaning.
Diffstat (limited to 'src/mailman/database')
| -rw-r--r-- | src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py b/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py new file mode 100644 index 000000000..e4dc25ab8 --- /dev/null +++ b/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py @@ -0,0 +1,36 @@ +"""add_serverowner_domainowner + +Revision ID: 46e92facee7 +Revises: 33e1f5f6fa8 +Create Date: 2015-03-20 16:01:25.007242 + +""" + +# revision identifiers, used by Alembic. +revision = '46e92facee7' +down_revision = '33e1f5f6fa8' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.create_table('domain_owner', + sa.Column('user_id', sa.Integer(), nullable=False), + sa.Column('domain_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['domain_id'], ['domain.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('user_id', 'domain_id') + ) + op.add_column('user', sa.Column('is_server_owner', sa.Boolean(), + nullable=True)) + if op.get_bind().dialect.name != 'sqlite': + op.drop_column('domain', 'contact_address') + + +def downgrade(): + if op.get_bind().dialect.name != 'sqlite': + op.drop_column('user', 'is_server_owner') + op.add_column('domain', sa.Column('contact_address', sa.VARCHAR(), + nullable=True)) + op.drop_table('domain_owner') |
