diff options
Diffstat (limited to 'src/mailman/database')
| -rw-r--r-- | src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py | 25 |
1 files changed, 8 insertions, 17 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 index 613e4d22d..e4dc25ab8 100644 --- a/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py +++ b/src/mailman/database/alembic/versions/46e92facee7_add_serverowner_domainowner.py @@ -15,31 +15,22 @@ 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.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') - # 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.drop_column('user', 'is_server_owner') 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 ### + op.drop_table('domain_owner') |
