Created
September 20, 2017 15:16
-
-
Save sumanthkumarc/d5c575378a16c5105fa7c82fe6fd4229 to your computer and use it in GitHub Desktop.
Drupal 8: get and set schema version numbers in database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // All these are found in core/includes/schema.inc | |
| // Get schema version for your module. | |
| drupal_get_installed_schema_version('MY_MODULE'); | |
| // schema version number is N in hook_update_N | |
| drupal_set_installed_schema_version('MY_MODULE', 'Schema_version_number'); | |
| // Get all schema versions for all modules. | |
| $versions = \Drupal::keyValue('system.schema')->getAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment