diff --git a/data/server.csv b/data/server.csv index fe0d2b9e..cfc85ca0 100644 --- a/data/server.csv +++ b/data/server.csv @@ -2,6 +2,7 @@ 32587,Gonzales,courtesy_card 03552,McCulley,courtesy_card 42687,Álvarez,courtesy_card +65149,Álvarez,courtesy_card 89768,Muñoz,courtesy_card 41782,Núñez,courtesy_card 48727,de Merida,courtesy_card diff --git a/eligibility_server/db/models.py b/eligibility_server/db/models.py index 2101e40d..f4d1bf1b 100644 --- a/eligibility_server/db/models.py +++ b/eligibility_server/db/models.py @@ -19,7 +19,7 @@ def __repr__(self): class User(db.Model): id = db.Column(db.Integer, primary_key=True) sub = db.Column(db.String, unique=True, nullable=False) - name = db.Column(db.String, unique=True, nullable=False) + name = db.Column(db.String, unique=False, nullable=False) types = db.relationship("Eligibility", secondary=user_eligibility, lazy="subquery", backref=db.backref("users", lazy=True)) def __repr__(self): diff --git a/tests/db/test_setup.py b/tests/db/test_setup.py index db3507da..cb4f1c7b 100644 --- a/tests/db/test_setup.py +++ b/tests/db/test_setup.py @@ -14,7 +14,7 @@ def test_init_db_command(runner): assert result.exit_code == 0 - assert User.query.count() == 24 + assert User.query.count() == 25 assert Eligibility.query.count() == 1 user_with_one_eligibility = User.query.filter_by(sub="32587", name="Gonzales").first()