The module sqldiff config file allows for updates to the datamodel for a module. The file is checked on startup of the module. The child diff tags are iterated over in a top down fashion. The earliest diff should be at the top and the most recent diff should be at the bottom. While iterating, if the current module database version is less than the given version, the sql in the sql tag is executed.
The xml doctype for the config file should be defined as:
<!DOCTYPE sqldiff PUBLIC "-//OpenMRS//DTD OpenMRS SQL Diff Config 1.0//EN" "http://resources.openmrs.org/doctype/sqldiff-1.0.dtd">
(Contains 0 to n diff tags)
diff
- version: String referring to the unique extension point labeled the same in the code
- author: Any string referring to the person that created this. Usually use for openmrs id username.
- date: Only used for convenience. Should be the date the sql was added to the file
- description: Text describing what the sql diff is doing. Only used for convenience when reading through sqldiff file later
- sql: Contains the sql statements. Separate statements should be delimited by semi colons: ;
sqldiff-1.0.dtd:
Viewable contents of http://resources.openmrs.org/doctype/sqldiff-1.0.dtd made available here:
<?xml version="1.0" encoding="UTF-8"?> <!-- Top level configuration element. \--> <!ELEMENT sqldiff ( (help?), (diff*) )> <!ATTLIST sqldiff version CDATA #FIXED "1.0"> <!ELEMENT diff (version, author, date, description, sql)>