diff options
| author | Abhilash Raj | 2015-03-27 22:51:39 +0530 |
|---|---|---|
| committer | Abhilash Raj | 2015-03-27 22:51:39 +0530 |
| commit | 381f7ceb2d55179365809bf3b8f98313d9e86099 (patch) | |
| tree | 53a6907f52898d0c7db8fd7fda065416bb4efafa /src/mailman/database | |
| parent | b2c2507402f0578e86bc37bac0711979270e8821 (diff) | |
| parent | c5b114328eac659bb0f33f9727efffea88dc3542 (diff) | |
| download | mailman-381f7ceb2d55179365809bf3b8f98313d9e86099.tar.gz mailman-381f7ceb2d55179365809bf3b8f98313d9e86099.tar.zst mailman-381f7ceb2d55179365809bf3b8f98313d9e86099.zip | |
merge serverowner branch
Diffstat (limited to 'src/mailman/database')
| -rw-r--r-- | src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py | 45 |
1 files changed, 45 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..613e4d22d --- /dev/null +++ b/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py @@ -0,0 +1,45 @@ +"""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(): + ### commands auto generated by Alembic - please adjust! ### + op.create_table('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') + # The migration below may be because the first migration was created + # before we changed this attribute to a primary_key + op.create_foreign_key('_preferred_address', 'user', 'address', + ['_preferred_address_id'], ['id']) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_column('user', 'is_server_owner') + if op.get_bind().dialect.name != 'sqlite': + op.add_column('domain', sa.Column('contact_address', sa.VARCHAR(), + nullable=True)) + op.drop_constraint('_preferred_address', 'user', type_='foreignkey') + op.drop_table('owner') + ### end Alembic commands ### |
