Name all constraints when creating them

Prefious commit set the constraint names for existing databases.
New databases can now have named constraints from the ground up.
master
kaiyou 6 years ago
parent b8282b1d46
commit b88f61f183

@ -23,8 +23,8 @@ def upgrade():
sa.Column('user_email', sa.String(length=255), nullable=False),
sa.Column('password', sa.String(length=255), nullable=False),
sa.Column('ip', sa.String(length=255), nullable=True),
sa.ForeignKeyConstraint(['user_email'], ['user.email'], ),
sa.PrimaryKeyConstraint('id')
sa.ForeignKeyConstraint(['user_email'], ['user.email'], name=op.f('token_user_email_fkey')),
sa.PrimaryKeyConstraint('id', name=op.f('token_pkey'))
)

@ -21,7 +21,7 @@ def upgrade():
sa.Column('comment', sa.String(length=255), nullable=True),
sa.Column('name', sa.String(length=80), nullable=False),
sa.Column('smtp', sa.String(length=80), nullable=True),
sa.PrimaryKeyConstraint('name')
sa.PrimaryKeyConstraint('name', name=op.f('relay_pkey'))
)

@ -21,8 +21,8 @@ def upgrade():
sa.Column('comment', sa.String(length=255), nullable=True),
sa.Column('name', sa.String(length=80), nullable=False),
sa.Column('domain_name', sa.String(length=80), nullable=True),
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], ),
sa.PrimaryKeyConstraint('name')
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], name=op.f('alternative_domain_name_fkey')),
sa.PrimaryKeyConstraint('name', name=op.f('alternative_pkey'))
)

@ -17,7 +17,7 @@ def upgrade():
op.create_table('config',
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('value', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('name')
sa.PrimaryKeyConstraint('name', name=op.f('config_pkey'))
)

@ -22,7 +22,7 @@ def upgrade():
sa.Column('name', sa.String(length=80), nullable=False),
sa.Column('max_users', sa.Integer(), nullable=False),
sa.Column('max_aliases', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('name')
sa.PrimaryKeyConstraint('name', name=op.f('domain_pkey'))
)
op.create_table('alias',
sa.Column('created_at', sa.Date(), nullable=False),
@ -32,8 +32,8 @@ def upgrade():
sa.Column('destination', sa.String(length=1023), nullable=False),
sa.Column('domain_name', sa.String(length=80), nullable=False),
sa.Column('email', sa.String(length=255), nullable=False),
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], ),
sa.PrimaryKeyConstraint('email')
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], name=op.f('alias_domain_name_fkey')),
sa.PrimaryKeyConstraint('email', name=op.f('alias_pkey'))
)
op.create_table('user',
sa.Column('created_at', sa.Date(), nullable=False),
@ -55,8 +55,8 @@ def upgrade():
sa.Column('spam_threshold', sa.Numeric(), nullable=False),
sa.Column('domain_name', sa.String(length=80), nullable=False),
sa.Column('email', sa.String(length=255), nullable=False),
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], ),
sa.PrimaryKeyConstraint('email')
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], name=op.f('user_domain_name_fkey')),
sa.PrimaryKeyConstraint('email', name=op.f('user_pkey'))
)
op.create_table('fetch',
sa.Column('created_at', sa.Date(), nullable=False),
@ -70,14 +70,14 @@ def upgrade():
sa.Column('tls', sa.Boolean(), nullable=False),
sa.Column('username', sa.String(length=255), nullable=False),
sa.Column('password', sa.String(length=255), nullable=False),
sa.ForeignKeyConstraint(['user_email'], ['user.email'], ),
sa.PrimaryKeyConstraint('id')
sa.ForeignKeyConstraint(['user_email'], ['user.email'], name=op.f('fetch_user_email_fkey')),
sa.PrimaryKeyConstraint('id', name=op.f('fetch_pkey'))
)
op.create_table('manager',
sa.Column('domain_name', sa.String(length=80), nullable=True),
sa.Column('user_email', sa.String(length=255), nullable=True),
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], ),
sa.ForeignKeyConstraint(['user_email'], ['user.email'], )
sa.ForeignKeyConstraint(['domain_name'], ['domain.name'], name=op.f('manager_domain_name_fkey')),
sa.ForeignKeyConstraint(['user_email'], ['user.email'], name=op.f('manager_user_email_fkey'))
)

Loading…
Cancel
Save