We usually develop a system that must be upgraded frequently. Upgrading means modifying the code or data structure. Of course, you should try to modify the data structure as little as possible in the next system.
So how should we provide updates for users to upgrade when others are not currently using the latest version?
Version Number
First, there is no doubt that each download of a version should have a corresponding version number for differentiation. In this way, if the current user version is different from the latest version, it indicates that the user should be updated.
Patch updates
Second, how to provide updates. Method 1: only modified files are provided, and the modified files should be packaged according to the system directory. For example, I modified the index in the admin folder in the system directory. the PHP file cannot be directly stored in the patch. PHP, but to create a new admin folder, the modified index. after saving the PHP file, package the Admin directory. Method 2: Package the system as a whole no matter how many files are modified. The patch package should contain detailed update instructions and update methods.
How to update a user
Third, how to make the user update. Both methods allow the user to download the patch and overwrite the original file. Of course, the user should be prompted to back up the original file based on insurance considerations. You can separately download the update package or provide online updates.
Data Structure update
Fourth, update the data structure. This is not the same as updating the Code. It is a little special. Because data may already exist in the database, you must not delete the original database and generate a new database. So what should we do? You can only operate on a specific table by modifying statements, such as adding or deleting fields, adding or deleting a table.
Cross-version update
Fifth, how to upgrade a large version span. Some users may use an old version, which is separated from the latest version. How can they upgrade the version? The most insurance is the installation of a patch and a patch. If one-time installation is required, different installation packages must be created based on different versions, because only one file may be changed from version 1 to version 2, and only one file may be changed from version 2 to version 3, however, two files have been changed from version 1 to version 3, so it is necessary to create different installation packages based on different versions.
In short, the most important thing to update a patch is to be able to accurately identify the difference between the current version and the latest version, and then download the corresponding patch. Exercise caution when modifying the data structure. In general, you can add a new table or field, but avoid deleting it as much as possible.
Link: http://mingkr.com/system-update