PHPackages                             smalldb/libchangelog\_sql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. smalldb/libchangelog\_sql

ActiveLibrary[Database &amp; ORM](/categories/database)

smalldb/libchangelog\_sql
=========================

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

v1.2(10y ago)1141Apache-2.0PHP

Since Jun 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/smalldb/libchangelog-sql)[ Packagist](https://packagist.org/packages/smalldb/libchangelog_sql)[ RSS](/packages/smalldb-libchangelog-sql/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

Changelog.SQL
=============

[](#changelogsql)

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.

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

See cascade plugin changelog\_sql for usage example.

Usage
-----

[](#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.

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

@warning You must set your client to stop on errors. Otherwise things go bad.

@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.

### Example of the Script

[](#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 (;).

Init scripts
------------

[](#init-scripts)

In `app/database/changelog.sql/init` directory can be placed scripts which should be executed every time something is changed in database.

License
-------

[](#license)

The most of the code is published under Apache 2.0 license. See [LICENSE](doc/license.md) file for details.

Contribution guidelines
-----------------------

[](#contribution-guidelines)

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

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~364 days

Total

3

Last Release

3664d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16572?v=4)[Josef Kufner](/maintainers/jkufner)[@jkufner](https://github.com/jkufner)

---

Top Contributors

[![jkufner](https://avatars.githubusercontent.com/u/16572?v=4)](https://github.com/jkufner "jkufner (37 commits)")

---

Tags

databasemigrationsphpsmalldbsql-script

### Embed Badge

![Health badge](/badges/smalldb-libchangelog-sql/health.svg)

```
[![Health](https://phpackages.com/badges/smalldb-libchangelog-sql/health.svg)](https://phpackages.com/packages/smalldb-libchangelog-sql)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
