2017 © Pedro Peláez
 

library libchangelog_sql

image

smalldb/libchangelog_sql

  • Wednesday, April 4, 2018
  • by jkufner
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Changelog.SQL

Changelog.SQL is simple tool to maintain changes in database. It is based on directory of SQL scripts and simple SQL table where are recorded already executed scripts., (*1)

This package contains a library meant to be integrated into your project. Just initialize whatever framework you use and call Smalldb\ChangelogSql\CliMain::main()`., (*2)

See cascade plugin changelog_sql for usage example., (*3)

Usage

When database is modified, place SQL script which performs this modification into app/database/changelog.sql directory and commit it. This script will remain there forever., (*4)

After deploy on a server run your changelog-sql script and you will see SQL code required to reproduce all changes on the server., (*5)

@warning You must set your client to stop on errors. Otherwise things go bad., (*6)

@note The Trick: Each file has simple insert at its end. This insert records successful execution of given script into database. Filename specified in this insert must match filename of the script., (*7)

Example of the Script

ALTER ... whatever you need;
UPDATE ... data that needs to be modified;

--
INSERT INTO `about_changelog`
SET `filename` = '0000-00-00-about_changelog.sql';

@warning Do not forget final semicolon (;)., (*8)

Init scripts

In app/database/changelog.sql/init directory can be placed scripts which should be executed every time something is changed in database., (*9)

License

The most of the code is published under Apache 2.0 license. See LICENSE file for details., (*10)

Contribution guidelines

There is no bug tracker yet, so send me an e-mail and we will figure it out., (*11)

If you wish to send me a patch, please create a Git pull request or send a Git formatted patch via email., (*12)

The Versions

04/04 2018

v0.0

0.0.0.0

  Sources   Download

18/06 2016

dev-master

9999999-dev https://smalldb.org/

Changelog.SQL is simple and elegant tool to maintain database changes. This package is a library meant to be integrated into your project

  Sources   Download

Apache-2.0

The Development Requires

by Josef Kufner

17/06 2016

v1.2

1.2.0.0

Changelog.SQL is simple and elegant tool to maintain database changes. This package is a library meant to be integrated into your project

  Sources   Download

Apache-2.0

The Development Requires

by Josef Kufner

10/02 2015

v1.1

1.1.0.0

Changelog.SQL is simple and elegant tool to maintain database changes. This package is a library meant to be integrated into your project

  Sources   Download

Apache-2.0

by Josef Kufner

20/06 2014

v1.0

1.0.0.0

Changelog.SQL is simple and elegant tool to maintain database changes.

  Sources   Download

Apache-2.0

The Requires

  • cascade/composer-plugin >=1.1
  • cascade/core >=0.11

 

by Josef Kufner