FACG4 / Care-And-Share-App

Care and Share
https://careandshare.herokuapp.com/
MIT License
0 stars 0 forks source link

database schema #5

Open emanKhaledh opened 6 years ago

emanKhaledh commented 6 years ago

37638170_1802611913151665_3183800900804149248_n

akre54 commented 6 years ago

Hey! Schema looks great so far. It looks like you really get how to design a relational database.

Couple quick nits: you have a typo in your discussions schema -- "massage" should be "message" (unless you're talking about a back rub!) and I'm curious why age is a date? Shouldn't the field store date of birth instead, so you can subtract today's date from their date of birth and get their age? That way you don't need to update the table every time they get a year older.

Also, I'm wondering why state and role are both tables, since it seems like their only use is to map an id to a string representation. I think you might want to use an enum instead.

And lastly, you should never store the password in plain text. The best practice these days is to store a hash of the password with a "salt", or better yet use an authentication library like Passport to handle users logging in and out. Let me know if you need help with this.

Otherwise looks great! Looking forward to see where you take this.

emanKhaledh commented 6 years ago

we use state table coz. the connection between two persons maybe accept or reject or suspend this insert in state table and state-id in connection table ,Well we will use enum and age we mean date of birth i will change to Date of birth and password we will deal with that . after repair we push scheme to take feedback from you :smile: