courselab / pollex

Open Source Online Poll Application
GNU General Public License v3.0
1 stars 9 forks source link

Model database #24

Open Vernalhav opened 4 years ago

Vernalhav commented 4 years ago

We must define which fields are going to be present in our database.

Vernalhav commented 4 years ago

I think we should have two tables: one for users and one for polls. Each user and each poll should have a unique ID so that they can be referenced. The user should have a list of poll IDs they have created (and maybe another list with the IDs they have participated in). The poll should have the title, ID of the user that created and how many votes there are for each category. I believe adding in more information is not our priority since we aim to release an MVP.

leodaher commented 4 years ago

I agree with @Vernalhav , two tables, one for the users and the other for polls, is fine. What database system should we use? What do you think of PostgreSQL, so we can use SQLAlchemy, which is a widely used ORM. There's even Flask-SQLAlchemy, which is specific for Flask.

leodaher commented 4 years ago

I've made a PR to configure Flask-SQLAlchemy, and the database. https://github.com/flossschool/pollex/pull/33

gdezan commented 4 years ago

I've created a pull request to keep working on @leodaher 's changes https://github.com/flossschool/pollex/pull/35

LuisF3 commented 4 years ago

@ET33 was working on it last class. Have you finished it?

leodaher commented 4 years ago

I guess with @gdezan PR, it is done.

LuisF3 commented 4 years ago

I left a comment there (PR #35 ). I think we need a bit more modeling and there I explained some flaws I could find. Let me know what you guys think.

And please, leave a reference when referencing a PR or Issue :)

ET33 commented 4 years ago

Thanks for starting this. I think only 2 tables is insufficient to test the voting system, etc. So I've suggested some other tables here