My opportunity have create a web application using php + mysql. The machine can show a product's original cost and discount cost towards the user. Should you haven't logined, you receive the initial cost, should you loginned , you receive the discount cost. It's pretty clear to see.
But my opportunity want more features within the system, it wish to display different prices base on different user. For instance, user A is really a golden parnter, he is able to get 50% off. User B is really a silver parnter, have only thirty percent off. But this logic isn't prepare within the original system, so I have to then add attribute within the database, a minimum of a person key in this situation. Can there be any recommendation regarding how to merge current database to my latest version of database. Also, all of the data should preserver, and also the server should works 24/7. (within steer clear of the database)
Can you really achieve this? Furthermore , any recommend for future maintaince advice? Thz u.
Listed here are more concrete good examples of ALTER TABLE.
You can include the required posts for your table with ALTER TABLE, then set the consumer type for every user with UPDATE. Then deploy the brand new version of the application. that utilizes the brand new column.
I would suggest writing something to operate SQL queries for your databases incrementally. Similar to Rails migrations.
Within the system I'm presently focusing on, we've such tool designed in python, we title our scripts something similar to 000000_somename.sql, in which the 0s may be the revision number within our SCM (subversion), and also the tool operates included in development/testing and lastly implementing to production.
It has the advantage of having the ability to go in time when it comes to database changes, similar to in code (if you are using a resource code version control tool) too.