This commit is contained in:
2022-12-30 16:23:27 +00:00
parent 02776e8478
commit 20da343c54
1304 changed files with 870224 additions and 0 deletions

1
app/migrations/README Normal file
View File

@ -0,0 +1 @@
Generic single-database configuration.

87
app/migrations/env.py Normal file
View File

@ -0,0 +1,87 @@
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
import sys
# hack to be able to import Base
# cf https://stackoverflow.com/a/58891735/1428034
sys.path = ['', '..'] + sys.path[1:]
from app.models import Base
from app.config import DB_URI
target_metadata = Base.metadata
# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
config.set_main_option('sqlalchemy.url', DB_URI)
def run_migrations_offline():
"""Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.
"""
url = config.get_main_option("sqlalchemy.url")
context.configure(
url=url,
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
)
with context.begin_transaction():
context.run_migrations()
def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
connectable = engine_from_config(
config.get_section(config.config_ini_section),
prefix="sqlalchemy.",
poolclass=pool.NullPool,
)
with connectable.connect() as connection:
context.configure(
connection=connection, target_metadata=target_metadata
)
with context.begin_transaction():
context.run_migrations()
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()

View File

@ -0,0 +1,25 @@
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
def upgrade():
${upgrades if upgrades else "pass"}
def downgrade():
${downgrades if downgrades else "pass"}

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 0256244cd7c8
Revises: 3cd10cfce8c3
Create Date: 2019-06-28 11:19:50.401222
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0256244cd7c8'
down_revision = '3cd10cfce8c3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('activation_code', sa.Column('expired', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('activation_code', 'expired')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 0a89c670fc7a
Revises: d68a2d971b70
Create Date: 2019-11-18 15:18:23.494405
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0a89c670fc7a'
down_revision = 'd68a2d971b70'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('deleted_alias_user_id_key', 'deleted_alias', type_='unique')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('deleted_alias_user_id_key', 'deleted_alias', ['user_id'])
# ### end Alembic commands ###

View File

@ -0,0 +1,39 @@
"""empty message
Revision ID: 0b28518684ae
Revises: a8d8aa307b8b
Create Date: 2019-11-30 18:22:02.869387
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0b28518684ae'
down_revision = 'a8d8aa307b8b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('users_stripe_card_token_key', 'users', type_='unique')
op.drop_constraint('users_stripe_customer_id_key', 'users', type_='unique')
op.drop_constraint('users_stripe_subscription_id_key', 'users', type_='unique')
op.drop_column('users', 'stripe_customer_id')
op.drop_column('users', 'stripe_card_token')
op.drop_column('users', 'stripe_subscription_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('stripe_subscription_id', sa.VARCHAR(length=128), autoincrement=False, nullable=True))
op.add_column('users', sa.Column('stripe_card_token', sa.VARCHAR(length=128), autoincrement=False, nullable=True))
op.add_column('users', sa.Column('stripe_customer_id', sa.VARCHAR(length=128), autoincrement=False, nullable=True))
op.create_unique_constraint('users_stripe_subscription_id_key', 'users', ['stripe_subscription_id'])
op.create_unique_constraint('users_stripe_customer_id_key', 'users', ['stripe_customer_id'])
op.create_unique_constraint('users_stripe_card_token_key', 'users', ['stripe_card_token'])
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 0c7f1a48aac9
Revises: 2d2fc3e826af
Create Date: 2019-12-15 21:49:02.167122
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0c7f1a48aac9'
down_revision = '2d2fc3e826af'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_custom_domain')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_custom_domain', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 18e934d58f55
Revises: 0c7f1a48aac9
Create Date: 2019-12-22 16:31:33.531138
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '18e934d58f55'
down_revision = '0c7f1a48aac9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('gen_email', 'custom')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('gen_email', sa.Column('custom', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 1b7d161d1012
Revises: c6e7fc37ad42
Create Date: 2019-07-23 22:58:59.673800
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1b7d161d1012'
down_revision = 'c6e7fc37ad42'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'is_developer')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('is_developer', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 696e17c13b8b
Revises: e409f6214b2b
Create Date: 2019-12-29 10:43:29.169736
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '696e17c13b8b'
down_revision = 'e409f6214b2b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('spf_verified', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'spf_verified')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: e409f6214b2b
Revises: d4e4488a0032
Create Date: 2019-12-29 10:29:44.979846
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e409f6214b2b'
down_revision = 'd4e4488a0032'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('alias_generator', sa.Integer(), server_default='1', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'alias_generator')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: a8b996f0be40
Revises: 696e17c13b8b
Create Date: 2019-12-30 00:22:25.114359
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a8b996f0be40'
down_revision = '696e17c13b8b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('notification', sa.Boolean(), server_default='1', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'notification')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 01f808f15b2e
Revises: 10ad2dbaeccf
Create Date: 2019-12-30 18:47:17.726860
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '01f808f15b2e'
down_revision = '10ad2dbaeccf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('gen_email', sa.Column('automatic_creation', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('gen_email', 'automatic_creation')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 10ad2dbaeccf
Revises: 696e17c13b8b
Create Date: 2019-12-30 18:16:40.110999
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '10ad2dbaeccf'
down_revision = 'a8b996f0be40'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('catch_all', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'catch_all')
# ### end Alembic commands ###

View File

@ -0,0 +1,39 @@
"""empty message
Revision ID: d29cca963221
Revises: 01f808f15b2e
Create Date: 2020-01-01 20:01:51.861329
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd29cca963221'
down_revision = '01f808f15b2e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('lifetime_coupon',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('code', sa.String(length=128), nullable=False),
sa.Column('nb_used', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('code')
)
op.add_column('users', sa.Column('lifetime', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'lifetime')
op.drop_table('lifetime_coupon')
# ### end Alembic commands ###

View File

@ -0,0 +1,42 @@
"""empty message
Revision ID: ba6f13ccbabb
Revises: d29cca963221
Create Date: 2020-01-08 21:23:06.288453
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ba6f13ccbabb'
down_revision = 'd29cca963221'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('directory',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=128), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.add_column('gen_email', sa.Column('directory_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'gen_email', 'directory', ['directory_id'], ['id'], ondelete='cascade')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'gen_email', type_='foreignkey')
op.drop_column('gen_email', 'directory_id')
op.drop_table('directory')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 7c39ba4ec38d
Revises: ba6f13ccbabb
Create Date: 2020-01-30 10:10:01.245257
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7c39ba4ec38d'
down_revision = 'ba6f13ccbabb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('trial_end', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'trial_end')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""empty message
Revision ID: 9c976df9b9c4
Revises: 7c39ba4ec38d
Create Date: 2020-02-03 13:08:29.049797
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9c976df9b9c4'
down_revision = '7c39ba4ec38d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('job',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('name', sa.String(length=128), nullable=False),
sa.Column('payload', sa.JSON(), nullable=True),
sa.Column('taken', sa.Boolean(), nullable=False),
sa.Column('run_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('job')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b9f849432543
Revises: 9c976df9b9c4
Create Date: 2020-02-05 15:16:16.912369
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b9f849432543'
down_revision = '9c976df9b9c4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('gen_email', sa.Column('note', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('gen_email', 'note')
# ### end Alembic commands ###

View File

@ -0,0 +1,43 @@
"""empty message
Revision ID: 6664d75ce3d4
Revises: b9f849432543
Create Date: 2020-02-10 23:10:09.134369
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6664d75ce3d4'
down_revision = 'b9f849432543'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('mailbox',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=256), nullable=False),
sa.Column('verified', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
op.add_column('gen_email', sa.Column('mailbox_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'gen_email', 'mailbox', ['mailbox_id'], ['id'], ondelete='cascade')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'gen_email', type_='foreignkey')
op.drop_column('gen_email', 'mailbox_id')
op.drop_table('mailbox')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 3c9542fc54e9
Revises: 6664d75ce3d4
Create Date: 2020-02-11 22:28:58.017384
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3c9542fc54e9'
down_revision = '6664d75ce3d4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_multiple_mailbox', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_multiple_mailbox')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 3fa3a648c8e7
Revises: 3c9542fc54e9
Create Date: 2020-02-22 12:53:31.293693
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3fa3a648c8e7'
down_revision = '3c9542fc54e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('forward_email_log', sa.Column('bounced', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('forward_email_log', 'bounced')
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: 903ec5f566e8
Revises: 3fa3a648c8e7
Create Date: 2020-02-23 14:11:46.332532
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '903ec5f566e8'
down_revision = '3fa3a648c8e7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('new_email', sa.String(length=256), nullable=True))
op.create_unique_constraint(None, 'mailbox', ['new_email'])
op.add_column('users', sa.Column('full_mailbox', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'full_mailbox')
op.drop_constraint(None, 'mailbox', type_='unique')
op.drop_column('mailbox', 'new_email')
# ### end Alembic commands ###

View File

@ -0,0 +1,39 @@
"""empty message
Revision ID: e3cb44b953f2
Revises: f580030d9beb
Create Date: 2020-02-23 16:43:45.843338
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e3cb44b953f2'
down_revision = 'f580030d9beb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('manual_subscription',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('end_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('comment', sa.Text(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('manual_subscription')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: f580030d9beb
Revises: 903ec5f566e8
Create Date: 2020-02-23 16:03:46.064813
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f580030d9beb'
down_revision = '903ec5f566e8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('default_mailbox_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'mailbox', ['default_mailbox_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'default_mailbox_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,50 @@
"""empty message
Revision ID: 75093e7ded27
Revises: e3cb44b953f2
Create Date: 2020-02-27 22:26:25.068117
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '75093e7ded27'
down_revision = 'e3cb44b953f2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('social_auth',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('social', sa.String(length=128), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id', 'social', name='uq_social_auth')
)
op.alter_column('users', 'password',
existing_type=sa.VARCHAR(length=128),
nullable=True)
op.alter_column('users', 'salt',
existing_type=sa.VARCHAR(length=128),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'salt',
existing_type=sa.VARCHAR(length=128),
nullable=False)
op.alter_column('users', 'password',
existing_type=sa.VARCHAR(length=128),
nullable=False)
op.drop_table('social_auth')
# ### end Alembic commands ###

View File

@ -0,0 +1,40 @@
"""empty message
Revision ID: 5f191273d067
Revises: 75093e7ded27
Create Date: 2020-02-28 19:08:15.570326
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5f191273d067'
down_revision = '75093e7ded27'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('account_activation',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('code', sa.String(length=10), nullable=False),
sa.Column('tries', sa.Integer(), nullable=False),
sa.CheckConstraint('tries >= 0', name='account_activation_tries_positive'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('account_activation')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 7eef64ffb398
Revises: 5f191273d067
Create Date: 2020-02-29 00:02:34.372338
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7eef64ffb398'
down_revision = '5f191273d067'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'full_mailbox')
op.drop_column('users', 'can_use_multiple_mailbox')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_multiple_mailbox', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
op.add_column('users', sa.Column('full_mailbox', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: 235355381f53
Revises: 7eef64ffb398
Create Date: 2020-03-05 21:37:42.266722
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '235355381f53'
down_revision = '7eef64ffb398'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('gen_email', 'mailbox_id',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('gen_email', 'mailbox_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: 628a5438295c
Revises: 235355381f53
Create Date: 2020-03-08 13:07:13.312858
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '628a5438295c'
down_revision = '235355381f53'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('pgp_finger_print', sa.String(length=512), nullable=True))
op.add_column('mailbox', sa.Column('pgp_public_key', sa.Text(), nullable=True))
op.add_column('users', sa.Column('can_use_pgp', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_pgp')
op.drop_column('mailbox', 'pgp_public_key')
op.drop_column('mailbox', 'pgp_finger_print')
# ### end Alembic commands ###

View File

@ -0,0 +1,45 @@
"""empty message
Revision ID: 11a35b448f83
Revises: 628a5438295c
Create Date: 2020-03-14 16:35:13.564982
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '11a35b448f83'
down_revision = '628a5438295c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('refused_email',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('full_report_path', sa.String(length=128), nullable=False),
sa.Column('path', sa.String(length=128), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('delete_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('full_report_path'),
sa.UniqueConstraint('path')
)
op.add_column('forward_email_log', sa.Column('refused_email_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'forward_email_log', 'refused_email', ['refused_email_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'forward_email_log', type_='foreignkey')
op.drop_column('forward_email_log', 'refused_email_id')
op.drop_table('refused_email')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 9081f1a90939
Revises: 11a35b448f83
Create Date: 2020-03-15 10:51:17.341046
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9081f1a90939'
down_revision = '11a35b448f83'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('refused_email', sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('refused_email', 'deleted')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""empty message
Revision ID: 91b69dfad2f1
Revises: 9081f1a90939
Create Date: 2020-03-16 21:15:48.652860
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "91b69dfad2f1"
down_revision = "9081f1a90939"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("users", "can_use_pgp")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"users",
sa.Column(
"can_use_pgp",
sa.BOOLEAN(),
server_default=sa.text("false"),
autoincrement=False,
nullable=False,
),
)
# ### end Alembic commands ###

View File

@ -0,0 +1,25 @@
"""empty message
Revision ID: 7744c5c16159
Revises: 9081f1a90939
Create Date: 2020-03-17 09:52:10.662573
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "7744c5c16159"
down_revision = "91b69dfad2f1"
branch_labels = None
depends_on = None
def upgrade():
op.rename_table("forward_email", "contact")
def downgrade():
op.rename_table("contact", "forward_email")

View File

@ -0,0 +1,56 @@
"""empty message
Revision ID: 0809266d08ca
Revises: e9395fe234a4
Create Date: 2020-03-17 11:56:05.392474
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "0809266d08ca"
down_revision = "e9395fe234a4"
branch_labels = None
depends_on = None
def upgrade():
# alias_used_on table
op.alter_column("alias_used_on", "gen_email_id", new_column_name="alias_id")
op.drop_constraint("uq_alias_used", "alias_used_on", type_="unique")
op.create_unique_constraint(
"uq_alias_used", "alias_used_on", ["alias_id", "hostname"]
)
op.drop_constraint(
"alias_used_on_gen_email_id_fkey", "alias_used_on", type_="foreignkey"
)
op.create_foreign_key(
None, "alias_used_on", "alias", ["alias_id"], ["id"], ondelete="cascade"
)
# client_user table
op.alter_column("client_user", "gen_email_id", new_column_name="alias_id")
op.drop_constraint(
"client_user_gen_email_id_fkey", "client_user", type_="foreignkey"
)
op.create_foreign_key(
None, "client_user", "alias", ["alias_id"], ["id"], ondelete="cascade"
)
# contact table
op.alter_column("contact", "gen_email_id", new_column_name="alias_id")
op.create_unique_constraint("uq_contact", "contact", ["alias_id", "website_email"])
op.drop_constraint("uq_forward_email", "contact", type_="unique")
op.drop_constraint("forward_email_gen_email_id_fkey", "contact", type_="foreignkey")
op.create_foreign_key(
None, "contact", "alias", ["alias_id"], ["id"], ondelete="cascade"
)
def downgrade():
# One-way only
# Too complex to downgrade
raise Exception("Cannot downgrade")

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 14167121af69
Revises: 7744c5c16159
Create Date: 2020-03-17 11:00:00.400334
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "14167121af69"
down_revision = "7744c5c16159"
branch_labels = None
depends_on = None
def upgrade():
op.alter_column("forward_email_log", "forward_id", new_column_name="contact_id")
op.drop_constraint(
"forward_email_log_forward_id_fkey", "forward_email_log", type_="foreignkey"
)
op.create_foreign_key(
None, "forward_email_log", "contact", ["contact_id"], ["id"], ondelete="cascade"
)
def downgrade():
op.alter_column("forward_email_log", "contact_id", new_column_name="forward_id")

View File

@ -0,0 +1,25 @@
"""empty message
Revision ID: 6e061eb84167
Revises: 14167121af69
Create Date: 2020-03-17 11:08:02.004125
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "6e061eb84167"
down_revision = "14167121af69"
branch_labels = None
depends_on = None
def upgrade():
op.rename_table("forward_email_log", "email_log")
def downgrade():
op.rename_table("email_log", "forward_email_log")

View File

@ -0,0 +1,25 @@
"""empty message
Revision ID: e9395fe234a4
Revises: 6e061eb84167
Create Date: 2020-03-17 11:37:33.157695
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "e9395fe234a4"
down_revision = "6e061eb84167"
branch_labels = None
depends_on = None
def upgrade():
op.rename_table("gen_email", "alias")
def downgrade():
op.rename_table("alias", "gen_email")

View File

@ -0,0 +1,45 @@
"""empty message
Revision ID: f4b8232fa17e
Revises: 0809266d08ca
Create Date: 2020-03-20 09:41:21.840221
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "f4b8232fa17e"
down_revision = "0809266d08ca"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("contact", sa.Column("user_id", sa.Integer(), nullable=True))
op.create_foreign_key(
None, "contact", "users", ["user_id"], ["id"], ondelete="cascade"
)
op.add_column("email_log", sa.Column("user_id", sa.Integer(), nullable=True))
op.create_foreign_key(
None, "email_log", "users", ["user_id"], ["id"], ondelete="cascade"
)
op.add_column("file", sa.Column("user_id", sa.Integer(), nullable=True))
op.create_foreign_key(
None, "file", "users", ["user_id"], ["id"], ondelete="cascade"
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "file", type_="foreignkey")
op.drop_column("file", "user_id")
op.drop_constraint(None, "email_log", type_="foreignkey")
op.drop_column("email_log", "user_id")
op.drop_constraint(None, "contact", type_="foreignkey")
op.drop_column("contact", "user_id")
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: dbd80d290f04
Revises: f4b8232fa17e
Create Date: 2020-03-20 10:11:59.542933
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "dbd80d290f04"
down_revision = "f4b8232fa17e"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("contact", "user_id", existing_type=sa.INTEGER(), nullable=False)
op.alter_column("email_log", "user_id", existing_type=sa.INTEGER(), nullable=False)
op.alter_column("file", "user_id", existing_type=sa.INTEGER(), nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("file", "user_id", existing_type=sa.INTEGER(), nullable=True)
op.alter_column("email_log", "user_id", existing_type=sa.INTEGER(), nullable=True)
op.alter_column("contact", "user_id", existing_type=sa.INTEGER(), nullable=True)
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: 30c13ca016e4
Revises: 4e4a759ac4b5
Create Date: 2020-03-20 12:28:12.901907
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '30c13ca016e4'
down_revision = '4e4a759ac4b5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('alias_used_on', 'user_id',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('alias_used_on', 'user_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 4e4a759ac4b5
Revises: dbd80d290f04
Create Date: 2020-03-20 12:12:45.699045
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4e4a759ac4b5'
down_revision = 'dbd80d290f04'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias_used_on', sa.Column('user_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'alias_used_on', 'users', ['user_id'], ['id'], ondelete='cascade')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'alias_used_on', type_='foreignkey')
op.drop_column('alias_used_on', 'user_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: 541ce53ab6e9
Revises: 30c13ca016e4
Create Date: 2020-03-22 16:51:01.141010
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '541ce53ab6e9'
down_revision = '30c13ca016e4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('refused_email', 'path',
existing_type=sa.VARCHAR(length=128),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('refused_email', 'path',
existing_type=sa.VARCHAR(length=128),
nullable=False)
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 67c61eead8d2
Revises: 541ce53ab6e9
Create Date: 2020-03-22 23:58:02.672562
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67c61eead8d2'
down_revision = '541ce53ab6e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('is_cc', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'is_cc')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 224fd8963462
Revises: 67c61eead8d2
Create Date: 2020-03-28 22:30:19.428692
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '224fd8963462'
down_revision = '67c61eead8d2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('use_via_format_for_sender', sa.Boolean(), server_default='1', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'use_via_format_for_sender')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 92baf66b268b
Revises: 224fd8963462
Create Date: 2020-03-30 17:48:21.584864
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '92baf66b268b'
down_revision = '224fd8963462'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('email_log', sa.Column('is_spam', sa.Boolean(), server_default='0', nullable=False))
op.add_column('email_log', sa.Column('spam_status', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('email_log', 'spam_status')
op.drop_column('email_log', 'is_spam')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 497cfd2a02e2
Revises: 92baf66b268b
Create Date: 2020-04-05 12:17:45.505741
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '497cfd2a02e2'
down_revision = '92baf66b268b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('name', sa.String(length=512), server_default=sa.text('NULL'), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'name')
# ### end Alembic commands ###

View File

@ -0,0 +1,42 @@
"""empty message
Revision ID: ea30c0b5b2e3
Revises: 497cfd2a02e2
Create Date: 2020-04-09 22:16:58.923473
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ea30c0b5b2e3'
down_revision = '497cfd2a02e2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('referral',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('code', sa.String(length=128), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('code')
)
op.add_column('users', sa.Column('referral_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'referral', ['referral_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'referral_id')
op.drop_table('referral')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: bfd7b2302903
Revises: ea30c0b5b2e3
Create Date: 2020-04-13 13:21:14.857574
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bfd7b2302903'
down_revision = 'ea30c0b5b2e3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('intro_shown', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'intro_shown')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 57ef03f3ac34
Revises: bfd7b2302903
Create Date: 2020-04-13 20:49:01.061974
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '57ef03f3ac34'
down_revision = 'bfd7b2302903'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('manual_subscription', sa.Column('is_giveaway', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('manual_subscription', 'is_giveaway')
# ### end Alembic commands ###

View File

@ -0,0 +1,47 @@
"""empty message
Revision ID: dd911f880b75
Revises: 57ef03f3ac34
Create Date: 2020-04-19 11:14:19.929910
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dd911f880b75'
down_revision = '57ef03f3ac34'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('apple_subscription',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('expires_date', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('original_transaction_id', sa.String(length=256), nullable=False),
sa.Column('receipt_data', sa.Text(), nullable=False),
sa.Column('plan', sa.Enum('monthly', 'yearly', name='planenum_apple'), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id')
)
op.alter_column('file', 'user_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('file', 'user_id',
existing_type=sa.INTEGER(),
nullable=False)
op.drop_table('apple_subscription')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: bd05eac83f5f
Revises: dd911f880b75
Create Date: 2020-04-19 23:12:26.675833
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bd05eac83f5f'
down_revision = 'dd911f880b75'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint(None, 'apple_subscription', ['original_transaction_id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'apple_subscription', type_='unique')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b4146f7d5277
Revises: bd05eac83f5f
Create Date: 2020-04-26 10:26:18.625088
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b4146f7d5277'
down_revision = 'bd05eac83f5f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('name', sa.String(length=128), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'name')
# ### end Alembic commands ###

View File

@ -0,0 +1,33 @@
"""empty message
Revision ID: f939d67374e4
Revises: b4146f7d5277
Create Date: 2020-05-02 18:07:42.275092
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f939d67374e4'
down_revision = 'b4146f7d5277'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('referral', sa.Column('name', sa.String(length=512), nullable=True))
op.drop_constraint('users_referral_id_fkey', 'users', type_='foreignkey')
op.create_foreign_key(None, 'users', 'referral', ['referral_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.create_foreign_key('users_referral_id_fkey', 'users', 'referral', ['referral_id'], ['id'])
op.drop_column('referral', 'name')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: de1b457472e0
Revises: f939d67374e4
Create Date: 2020-05-03 12:02:11.958152
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'de1b457472e0'
down_revision = 'f939d67374e4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('dmarc_verified', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'dmarc_verified')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: ae94fe5c4e9f
Revises: de1b457472e0
Create Date: 2020-05-03 15:24:23.151311
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ae94fe5c4e9f'
down_revision = 'de1b457472e0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('name', sa.String(length=128), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'name')
# ### end Alembic commands ###

View File

@ -0,0 +1,43 @@
"""empty message
Revision ID: 026e7a782ed6
Revises: ae94fe5c4e9f
Create Date: 2020-05-07 17:51:48.440962
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '026e7a782ed6'
down_revision = 'ae94fe5c4e9f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_fido', sa.Boolean(), server_default='0', nullable=False))
op.add_column('users', sa.Column('fido_credential_id', sa.String(), nullable=True))
op.add_column('users', sa.Column('fido_pk', sa.String(), nullable=True))
op.add_column('users', sa.Column('fido_sign_count', sa.Integer(), nullable=True))
op.add_column('users', sa.Column('fido_uuid', sa.String(), nullable=True))
op.create_unique_constraint(None, 'users', ['fido_credential_id'])
op.create_unique_constraint(None, 'users', ['fido_pk'])
op.create_unique_constraint(None, 'users', ['fido_uuid'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='unique')
op.drop_constraint(None, 'users', type_='unique')
op.drop_constraint(None, 'users', type_='unique')
op.drop_column('users', 'fido_uuid')
op.drop_column('users', 'fido_sign_count')
op.drop_column('users', 'fido_pk')
op.drop_column('users', 'fido_credential_id')
op.drop_column('users', 'can_use_fido')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 925b93d92809
Revises: 026e7a782ed6
Create Date: 2020-05-07 21:42:05.406865
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '925b93d92809'
down_revision = '026e7a782ed6'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('uq_mailbox_user', 'mailbox', ['user_id', 'email'])
op.drop_constraint('mailbox_email_key', 'mailbox', type_='unique')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('mailbox_email_key', 'mailbox', ['email'])
op.drop_constraint('uq_mailbox_user', 'mailbox', type_='unique')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: bdf76f4b65a2
Revises: 925b93d92809
Create Date: 2020-05-09 14:38:21.695415
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bdf76f4b65a2'
down_revision = '925b93d92809'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('force_spf', sa.Boolean(), server_default='1', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'force_spf')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: a3a7c518ea70
Revises: bdf76f4b65a2
Create Date: 2020-05-09 18:33:49.991172
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a3a7c518ea70'
down_revision = 'bdf76f4b65a2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('deleted_alias_user_id_fkey', 'deleted_alias', type_='foreignkey')
op.drop_column('deleted_alias', 'user_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('deleted_alias', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False))
op.create_foreign_key('deleted_alias_user_id_fkey', 'deleted_alias', 'users', ['user_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""empty message
Revision ID: a5e3c6693dc6
Revises: a3a7c518ea70
Create Date: 2020-05-09 20:45:15.014387
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a5e3c6693dc6'
down_revision = 'a3a7c518ea70'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('sent_alert',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('to_email', sa.String(length=256), nullable=False),
sa.Column('alert_type', sa.String(length=256), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('sent_alert')
# ### end Alembic commands ###

View File

@ -0,0 +1,41 @@
"""empty message
Revision ID: bf11ab2f0a7a
Revises: a5e3c6693dc6
Create Date: 2020-05-10 16:41:48.038484
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bf11ab2f0a7a'
down_revision = 'a5e3c6693dc6'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('alias_mailbox',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('alias_id', sa.Integer(), nullable=False),
sa.Column('mailbox_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['alias_id'], ['alias.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['mailbox_id'], ['mailbox.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('alias_id', 'mailbox_id', name='uq_alias_mailbox')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('alias_mailbox')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 1759f73274ee
Revises: bf11ab2f0a7a
Create Date: 2020-05-10 18:33:55.376369
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1759f73274ee'
down_revision = 'bf11ab2f0a7a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('email_log', sa.Column('bounced_mailbox_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'email_log', 'mailbox', ['bounced_mailbox_id'], ['id'], ondelete='cascade')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'email_log', type_='foreignkey')
op.drop_column('email_log', 'bounced_mailbox_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,45 @@
"""empty message
Revision ID: 5cad8fa84386
Revises: a5e3c6693dc6
Create Date: 2020-05-15 15:10:00.096349
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5cad8fa84386"
down_revision = "552d735a2f1f"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("users", "use_via_format_for_sender", server_default=None)
op.alter_column(
"users",
"use_via_format_for_sender",
new_column_name="sender_format",
type_=sa.Integer(),
postgresql_using="use_via_format_for_sender::integer",
)
op.alter_column("users", "sender_format", server_default="1")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("users", "sender_format", server_default=None)
op.alter_column(
"users",
"sender_format",
new_column_name="use_via_format_for_sender",
type_=sa.Boolean(),
postgresql_using="sender_format::boolean",
)
op.alter_column("users", "use_via_format_for_sender", server_default="1")
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 552d735a2f1f
Revises: 1759f73274ee
Create Date: 2020-05-15 16:33:23.558895
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '552d735a2f1f'
down_revision = '1759f73274ee'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('alias_mailbox_user_id_fkey', 'alias_mailbox', type_='foreignkey')
op.drop_column('alias_mailbox', 'user_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias_mailbox', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False))
op.create_foreign_key('alias_mailbox_user_id_fkey', 'alias_mailbox', 'users', ['user_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###

View File

@ -0,0 +1,40 @@
"""empty message
Revision ID: c31cdf879ee3
Revises: 5cad8fa84386
Create Date: 2020-05-17 10:34:23.492008
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c31cdf879ee3'
down_revision = '5cad8fa84386'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('recovery_code',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('code', sa.String(length=16), nullable=False),
sa.Column('used', sa.Boolean(), nullable=False),
sa.Column('used_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id', 'code', name='uq_recovery_code')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('recovery_code')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 659d979b64ce
Revises: c31cdf879ee3
Create Date: 2020-05-17 12:50:53.360910
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '659d979b64ce'
down_revision = 'c31cdf879ee3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('disable_pgp', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'disable_pgp')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: ce15cf3467b4
Revises: 659d979b64ce
Create Date: 2020-05-17 19:38:30.255689
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ce15cf3467b4'
down_revision = '659d979b64ce'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('replace_reverse_alias', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'replace_reverse_alias')
# ### end Alembic commands ###

View File

@ -0,0 +1,40 @@
"""empty message
Revision ID: 0e08145f0499
Revises: ce15cf3467b4
Create Date: 2020-05-23 12:06:25.707402
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0e08145f0499'
down_revision = 'ce15cf3467b4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('domain_deleted_alias',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('email', sa.String(length=256), nullable=False),
sa.Column('domain_id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['domain_id'], ['custom_domain.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('domain_id', 'email', name='uq_domain_trash')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('domain_deleted_alias')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""empty message
Revision ID: 00532ac6d4bc
Revises: 0e08145f0499
Create Date: 2020-05-23 19:54:24.984674
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '00532ac6d4bc'
down_revision = '0e08145f0499'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('notification',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('message', sa.Text(), nullable=False),
sa.Column('read', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('notification')
# ### end Alembic commands ###

View File

@ -0,0 +1,41 @@
"""empty message
Revision ID: 10a7947fda6b
Revises: f680032cc361
Create Date: 2020-05-24 19:53:53.351545
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '10a7947fda6b'
down_revision = 'f680032cc361'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('mfa_browser',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('token', sa.String(length=64), nullable=False),
sa.Column('expires', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('token')
)
op.add_column('users', sa.Column('last_otp', sa.String(length=12), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'last_otp')
op.drop_table('mfa_browser')
# ### end Alembic commands ###

View File

@ -0,0 +1,53 @@
"""empty message
Revision ID: f680032cc361
Revises: 00532ac6d4bc
Create Date: 2020-05-24 19:03:10.209349
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f680032cc361'
down_revision = '00532ac6d4bc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('fido',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('credential_id', sa.String(), nullable=False),
sa.Column('uuid', sa.String(), nullable=False),
sa.Column('public_key', sa.String(), nullable=False),
sa.Column('sign_count', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=128), nullable=False),
sa.ForeignKeyConstraint(['uuid'], ['users.fido_uuid'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('public_key')
)
op.create_index(op.f('ix_fido_credential_id'), 'fido', ['credential_id'], unique=True)
op.drop_constraint('users_fido_credential_id_key', 'users', type_='unique')
op.drop_constraint('users_fido_pk_key', 'users', type_='unique')
op.drop_column('users', 'fido_sign_count')
op.drop_column('users', 'fido_pk')
op.drop_column('users', 'fido_credential_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('fido_credential_id', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('users', sa.Column('fido_pk', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('users', sa.Column('fido_sign_count', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_unique_constraint('users_fido_pk_key', 'users', ['fido_pk'])
op.create_unique_constraint('users_fido_credential_id_key', 'users', ['fido_credential_id'])
op.drop_index(op.f('ix_fido_credential_id'), table_name='fido')
op.drop_table('fido')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 4a7d35941602
Revises: 10a7947fda6b
Create Date: 2020-05-27 00:18:32.222689
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a7d35941602'
down_revision = '10a7947fda6b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('paid_lifetime', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'paid_lifetime')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: cfc013b6461a
Revises: 4a7d35941602
Create Date: 2020-05-27 14:11:16.016417
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cfc013b6461a'
down_revision = '4a7d35941602'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('cannot_be_disabled', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'cannot_be_disabled')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b2d51e4d94c8
Revises: cfc013b6461a
Create Date: 2020-05-28 20:37:54.991920
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b2d51e4d94c8'
down_revision = 'cfc013b6461a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_fido')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_fido', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic commands ###

View File

@ -0,0 +1,39 @@
"""empty message
Revision ID: 749c2b85d20f
Revises: b2d51e4d94c8
Create Date: 2020-06-05 23:10:18.164302
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '749c2b85d20f'
down_revision = 'b2d51e4d94c8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('directory_mailbox',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('directory_id', sa.Integer(), nullable=False),
sa.Column('mailbox_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['directory_id'], ['directory.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['mailbox_id'], ['mailbox.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('directory_id', 'mailbox_id', name='uq_directory_mailbox')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('directory_mailbox')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: a5b4dc311a89
Revises: 749c2b85d20f
Create Date: 2020-06-07 00:08:08.588009
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a5b4dc311a89'
down_revision = '749c2b85d20f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('pgp_finger_print', sa.String(length=512), nullable=True))
op.add_column('contact', sa.Column('pgp_public_key', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'pgp_public_key')
op.drop_column('contact', 'pgp_finger_print')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: a3c9a43e41f4
Revises: a5b4dc311a89
Create Date: 2020-06-25 13:02:21.128994
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a3c9a43e41f4'
down_revision = 'a5b4dc311a89'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('default_random_alias_domain_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'custom_domain', ['default_random_alias_domain_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'default_random_alias_domain_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 7128f87af701
Revises: a3c9a43e41f4
Create Date: 2020-06-28 11:18:22.765690
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7128f87af701'
down_revision = 'a3c9a43e41f4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('nb_failed_checks', sa.Integer(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'nb_failed_checks')
# ### end Alembic commands ###

View File

@ -0,0 +1,44 @@
"""empty message
Revision ID: 270d598c51e3
Revises: 7128f87af701
Create Date: 2020-07-04 23:32:25.297082
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '270d598c51e3'
down_revision = '7128f87af701'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('public_domain',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('domain', sa.String(length=128), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('domain')
)
op.add_column('users', sa.Column('default_random_alias_public_domain_id', sa.Integer(), nullable=True))
op.drop_constraint('users_default_random_alias_domain_id_fkey', 'users', type_='foreignkey')
op.create_foreign_key(None, 'users', 'custom_domain', ['default_random_alias_domain_id'], ['id'], ondelete='SET NULL')
op.create_foreign_key(None, 'users', 'public_domain', ['default_random_alias_public_domain_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_constraint(None, 'users', type_='foreignkey')
op.create_foreign_key('users_default_random_alias_domain_id_fkey', 'users', 'custom_domain', ['default_random_alias_domain_id'], ['id'])
op.drop_column('users', 'default_random_alias_public_domain_id')
op.drop_table('public_domain')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b77ab8c47cc7
Revises: 270d598c51e3
Create Date: 2020-07-23 11:08:34.913760
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b77ab8c47cc7'
down_revision = '270d598c51e3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('max_spam_score', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'max_spam_score')
# ### end Alembic commands ###

View File

@ -0,0 +1,39 @@
"""empty message
Revision ID: a2b95b04d1f7
Revises: b77ab8c47cc7
Create Date: 2020-08-01 12:43:56.049075
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a2b95b04d1f7'
down_revision = 'b77ab8c47cc7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('domain_mailbox',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('domain_id', sa.Integer(), nullable=False),
sa.Column('mailbox_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['domain_id'], ['custom_domain.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['mailbox_id'], ['mailbox.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('domain_id', 'mailbox_id', name='uq_domain_mailbox')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('domain_mailbox')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""empty message
Revision ID: 63fd3b240583
Revises: a2b95b04d1f7
Create Date: 2020-08-14 19:08:55.846514
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '63fd3b240583'
down_revision = 'a2b95b04d1f7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('monitoring',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('host', sa.String(length=256), nullable=False),
sa.Column('incoming_queue', sa.Integer(), nullable=False),
sa.Column('active_queue', sa.Integer(), nullable=False),
sa.Column('deferred_queue', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('monitoring')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 95938a93ea14
Revises: 63fd3b240583
Create Date: 2020-08-16 11:50:11.765301
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '95938a93ea14'
down_revision = '63fd3b240583'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('email_log', sa.Column('spam_score', sa.Float(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('email_log', 'spam_score')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b82bcad9accf
Revises: 95938a93ea14
Create Date: 2020-08-26 14:38:22.496570
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b82bcad9accf'
down_revision = '95938a93ea14'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('disable_email_spoofing_check', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'disable_email_spoofing_check')
# ### end Alembic commands ###

View File

@ -0,0 +1,44 @@
"""empty message
Revision ID: 84471852b610
Revises: b82bcad9accf
Create Date: 2020-09-10 20:15:10.956801
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '84471852b610'
down_revision = 'b82bcad9accf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('batch_import',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('file_id', sa.Integer(), nullable=False),
sa.Column('processed', sa.Boolean(), nullable=False),
sa.Column('summary', sa.Text(), nullable=True),
sa.ForeignKeyConstraint(['file_id'], ['file.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id')
)
op.add_column('alias', sa.Column('batch_import_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'alias', 'batch_import', ['batch_import_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'alias', type_='foreignkey')
op.drop_column('alias', 'batch_import_id')
op.drop_table('batch_import')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: b0e9a389939a
Revises: 84471852b610
Create Date: 2020-09-12 11:18:40.262432
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b0e9a389939a'
down_revision = '84471852b610'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('newsletter_alias_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'alias', ['newsletter_alias_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'newsletter_alias_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 198c3aca9d8d
Revises: b0e9a389939a
Create Date: 2020-09-14 17:55:47.322585
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '198c3aca9d8d'
down_revision = 'b0e9a389939a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('from_header', sa.Text(), nullable=True))
op.add_column('contact', sa.Column('mail_from', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'mail_from')
op.drop_column('contact', 'from_header')
# ### end Alembic commands ###

View File

@ -0,0 +1,40 @@
"""empty message
Revision ID: 58ad4df8583e
Revises: 198c3aca9d8d
Create Date: 2020-09-28 17:33:34.898353
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '58ad4df8583e'
down_revision = '198c3aca9d8d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('authorized_address',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('mailbox_id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=256), nullable=False),
sa.ForeignKeyConstraint(['mailbox_id'], ['mailbox.id'], ondelete='cascade'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('mailbox_id', 'email', name='uq_authorize_address')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('authorized_address')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 1abfc9e14d7e
Revises: 58ad4df8583e
Create Date: 2020-10-04 12:47:43.738037
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1abfc9e14d7e'
down_revision = '58ad4df8583e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('disabled', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'disabled')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 32b00d06d892
Revises: 1abfc9e14d7e
Create Date: 2020-10-11 20:37:15.088469
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '32b00d06d892'
down_revision = '1abfc9e14d7e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('random_prefix_generation', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'random_prefix_generation')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b17afc77ba83
Revises: 32b00d06d892
Create Date: 2020-10-12 13:24:36.666256
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b17afc77ba83'
down_revision = '32b00d06d892'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('disabled', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'disabled')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 54ca2dbf89c0
Revises: b17afc77ba83
Create Date: 2020-10-15 16:07:57.039554
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '54ca2dbf89c0'
down_revision = 'b17afc77ba83'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('public_domain', sa.Column('premium_only', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('public_domain', 'premium_only')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: eef0c404b531
Revises: 54ca2dbf89c0
Create Date: 2020-10-20 16:49:33.756896
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'eef0c404b531'
down_revision = '54ca2dbf89c0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('nb_failed_checks', sa.Integer(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'nb_failed_checks')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 84dec6c29c48
Revises: eef0c404b531
Create Date: 2020-10-21 19:00:43.087487
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '84dec6c29c48'
down_revision = 'eef0c404b531'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('lifetime_coupon', sa.Column('paid', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('lifetime_coupon', 'paid')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: d0f197979bd9
Revises: 84dec6c29c48
Create Date: 2020-11-07 12:47:44.131900
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd0f197979bd9'
down_revision = '84dec6c29c48'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('generic_subject', sa.String(length=78), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'generic_subject')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 9dc16e591f88
Revises: d0f197979bd9
Create Date: 2020-11-14 15:53:38.354575
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9dc16e591f88'
down_revision = 'd0f197979bd9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('contact', sa.Column('invalid_email', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('contact', 'invalid_email')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: ac41029fb329
Revises: 9dc16e591f88
Create Date: 2020-11-15 18:37:11.158507
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ac41029fb329'
down_revision = '9dc16e591f88'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('pinned', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'pinned')
# ### end Alembic commands ###

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: d1edb3cadec8
Revises: ac41029fb329
Create Date: 2020-11-24 11:14:24.208867
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd1edb3cadec8'
down_revision = 'ac41029fb329'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('disable_pgp', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'disable_pgp')
# ### end Alembic commands ###

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: 623662ea0e7e
Revises: d1edb3cadec8
Create Date: 2020-11-24 16:34:02.327556
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '623662ea0e7e'
down_revision = 'd1edb3cadec8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('email_log', sa.Column('mailbox_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'email_log', 'mailbox', ['mailbox_id'], ['id'], ondelete='cascade')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'email_log', type_='foreignkey')
op.drop_column('email_log', 'mailbox_id')
# ### end Alembic commands ###

Some files were not shown because too many files have changed in this diff Show More