ruby on rails - Add new column in user-database with controller of lecture -


i have little system users. user admin-rights can create new lecture. thats working.

now want solve problem users can sign lectures. want add new column (boolean type) e.g. lecture1 in users database when create new lecture. can set variable true if user sign up.

is idea or better have database (e.g. signupstatus) exercise_id, user_id. when there entry user has sign lecture.

or have better idea?

thanks :)

the table better. never want create such columns(lecture1...) in user table, each new lecture added in system. imagine series of such columns [lecture1,lecture2,lecture3,lecturen...] => totally unconventional , against design principles.

what want simple many-to-many relationship. lecture can enrolled many users; user can subscribe many lectures.

you should follow this guide achieve it.
create table - lectures_users , store lecture_id , user_id maintain relationship


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -