2017 © Pedro Peláez
 

library db-version-update

Package to update db structure acording to a target package version

image

scriptburn/db-version-update

Package to update db structure acording to a target package version

  • Wednesday, December 20, 2017
  • by codexian
  • Repository
  • 1 Watchers
  • 0 Stars
  • 235 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

## Package to update db structure acording to a target package version

Usage:

Create a child class like this (A sample child class has been provided as sampleDbUpdateService.php): class DbUpdateService extends \Scriptburn\UpdateDb {, (*1)

// will be called for target db version 1
public function update_routine_1()
{
    /* make sure to return true
    other wise db update will stop propogating
    and update process will run again
     */
    return true;
}
// will be called for target db version 2
public function update_routine_2()
{
    /* make sure to return true
    other wise db update will stop propogating
    and update process will run again
     */
    return true;
}

}, (*2)

Next we will Call the actual function that checks if db update is needed. Best place for this code will be in a middleware // make sure composer.json has a key named dbversion in it $optionalVersionData=['type' => 'composer', 'path' => "/path/to/composer.json"];, (*3)

$dbUpdateCheck = new App\Services\DbUpdateService(< instance of \ScriptBurn\Settings >, < instance of pdo connection >, $optionalVersionData);, (*4)

//If you passed $optionalVersionData as 3rd parameter to App\Services\DbUpdateService constructor you do not need to pass current db version to method maybeUpdate as second parameter $dbUpdateCheck->maybeUpdate('scriptburn/git-auto-deploy',< optional current db version no >'); , (*5)

The Versions

20/12 2017

dev-master

9999999-dev

Package to update db structure acording to a target package version

  Sources   Download

BSD-3-Clause

The Requires

 

db version

20/12 2017

1.0.1

1.0.1.0

Package to update db structure acording to a target package version

  Sources   Download

BSD-3-Clause

The Requires

 

db version

14/07 2017

1.0.0

1.0.0.0

Package to update db structure acording to a target package version

  Sources   Download

BSD-3-Clause

The Requires

 

db version