diff options
| author | Abhilash Raj | 2015-03-31 06:26:08 +0530 |
|---|---|---|
| committer | Abhilash Raj | 2015-03-31 06:26:08 +0530 |
| commit | fe12351e6f0e11f48bd714357f05aa7a34ec7e90 (patch) | |
| tree | 0afea29bfbc49f37f1b51c2e5b9cbe3fc4bbda79 /src/mailman/database | |
| parent | 583d0ff8d46555c2ac2a72d9affd7c0e8e236161 (diff) | |
| download | mailman-fe12351e6f0e11f48bd714357f05aa7a34ec7e90.tar.gz mailman-fe12351e6f0e11f48bd714357f05aa7a34ec7e90.tar.zst mailman-fe12351e6f0e11f48bd714357f05aa7a34ec7e90.zip | |
* Add `drop_column` inside sqlite check, fix indentation
* Change `Owner` to `DomainOwner`
* Fix indentation errors in docs
* add multiple owners using `add_owners`
* all dummy addresses should be using example.com, example.org to avoid conflict ever
* add dummy tests
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') |
