I’m looking to create a read-only table, and MYSQL permissions, I think, are the best way to do that.
Is this possible via a migration?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generate a migration file as follows,
Edit the file as follows,
think@thinkComputer:~/Agile/ajax1$ vi db/migrate20120620191050_add_permissions_to_table_name.rb
Run the rake task as follows,
In future if you want to revoke that permission, then do,
You would want to be the a mysql user who has grant permissions on “database1.table_name”, other wise you will get the following error,
The details about the mysql user and database is located in “config/database.yml”
Please let me know if this works!