Skip to content

Commit 1881c2a

Browse files
use != and fix typo
1 parent 4f023f7 commit 1881c2a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

migrations/versions/911b11318ef1_add_constraints_for_empty_strings.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
branch_labels = None
1616
depends_on = None
1717

18-
# migrations generated manually! Alembic did not these detect changes.
18+
# migrations generated manually! Alembic did not detect these changes.
1919

2020
def upgrade():
2121
# User table constraints
2222
with op.batch_alter_table('user', schema=None) as batch_op:
23-
batch_op.create_check_constraint(batch_op.f('user_email_non_empty_check'), "trim(email) <> ''")
24-
batch_op.create_check_constraint(batch_op.f('user_email_normalized_non_empty_check'), "trim(email_normalized) <> ''")
25-
batch_op.create_check_constraint(batch_op.f('user_password_hash_non_empty_check'), "trim(password_hash) <> ''")
23+
batch_op.create_check_constraint(batch_op.f('user_email_non_empty_check'), "trim(email) != ''")
24+
batch_op.create_check_constraint(batch_op.f('user_email_normalized_non_empty_check'), "trim(email_normalized) != ''")
25+
batch_op.create_check_constraint(batch_op.f('user_password_hash_non_empty_check'), "trim(password_hash) != ''")
2626

2727
# Category table constraint
2828
with op.batch_alter_table('category', schema=None) as batch_op:
29-
batch_op.create_check_constraint(batch_op.f('category_name_non_empty_check'), "trim(name) <> ''")
29+
batch_op.create_check_constraint(batch_op.f('category_name_non_empty_check'), "trim(name) != ''")
3030

3131
# Subcategory table constraint
3232
with op.batch_alter_table('subcategory', schema=None) as batch_op:
33-
batch_op.create_check_constraint(batch_op.f('subcategory_name_non_empty_check'), "trim(name) <> ''")
33+
batch_op.create_check_constraint(batch_op.f('subcategory_name_non_empty_check'), "trim(name) != ''")
3434

3535
# Product table constraint
3636
with op.batch_alter_table('product', schema=None) as batch_op:
37-
batch_op.create_check_constraint(batch_op.f('product_name_non_empty_check'), "trim(name) <> ''")
37+
batch_op.create_check_constraint(batch_op.f('product_name_non_empty_check'), "trim(name) != ''")
3838

3939

4040
def downgrade():

0 commit comments

Comments
 (0)