Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 966 Bytes

for_packages_developer.md

File metadata and controls

17 lines (13 loc) · 966 Bytes

Using the patch system from a package

If you are a package developer, there are chances that when installing your package, there are needs to modify the database structure (usually to create tables). The database patch system comes with a utility class that will help you to register database patches when your package is installed.

First, if you are not used to install processes, read the manual about install processes.

Now, all you need to know is there is a simple one line instruction to register a database patch from your install file:

DatabasePatchInstaller::registerPatch($moufManager, 
	"patchUniqueName",
	"The patch description",
	"vendor/mygroup/mypackage/database/up/myfile.sql", // SQL patch file, relative to ROOT_PATH
	"vendor/mygroup/mypackage/database/down/myfile.sql"); // Optional SQL revert patch file, relative to ROOT_PATH