fix: adds uniqueness constraint to users email field

This commit is contained in:
2024-11-17 18:19:08 -03:00
parent 0eb5344bf3
commit 5e39131856

View File

@@ -5,7 +5,7 @@ from app.extensions import db
class User(db.Model): class User(db.Model):
id = mapped_column(db.Integer, primary_key=True, autoincrement=True) id = mapped_column(db.Integer, primary_key=True, autoincrement=True)
username = mapped_column(db.String(255), nullable=False) username = mapped_column(db.String(255), nullable=False)
email = mapped_column(db.String(255), nullable=False) email = mapped_column(db.String(255), nullable=False, unique=True)
password = mapped_column(db.String(255), nullable=False) password = mapped_column(db.String(255), nullable=False)
name = mapped_column(db.String(255), nullable=False) name = mapped_column(db.String(255), nullable=False)
lastname = mapped_column(db.String(255), nullable=False) lastname = mapped_column(db.String(255), nullable=False)