PHPackages                             tuxboy/sdam - 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. tuxboy/sdam

ActiveLibrary

tuxboy/sdam
===========

1.0.5(7y ago)124PHPPHP &gt;=7.1.0

Since Aug 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/TuxBoy/SDAM)[ Packagist](https://packagist.org/packages/tuxboy/sdam)[ RSS](/packages/tuxboy-sdam/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/76b211eee7a7c4dfd0ba4e3562b2137a717dd6ba65d2abb51f3a35ea7f92c7dc/68747470733a2f2f7472617669732d63692e6f72672f547578426f792f5344414d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TuxBoy/Migration)

SDAM (Simple Database Auto Migration)
=====================================

[](#sdam-simple-database-auto-migration)

Manage the database migrations for your PHP app, this library was made for your migration to be launched automatically in your application

There is a demo of use [here](https://github.com/TuxBoy/Migration-demo)

Installation
------------

[](#installation)

```
    "require": {
        "tuxboy/sdam": "dev-master",
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@github.com:tuxboy/sdam.git"
        }
    ],
```

OR with packagist

```
$ composer require tuxboy/sdam
```

How to use it
-------------

[](#how-to-use-it)

```
\SDAM\Config::current()->configure(
    [
        \SDAM\Config::DATABASE => [
            'dbname'   => 'database_name',
            'user'     => 'root',
            'password' => '',
            'host'     => 'localhost',
            'driver'   => 'pdo_mysql',
        ], // OR use .env for the database config
        \SDAM\Config::ENV_FILE        => 'path/your/.env'
        \SDAM\Config::ENTITY_PATH     => 'App\Entity\\',
        \SDAM\Config::AUTO_DROP_FIELD => false, // Optional (default value is true)
    ]
);

// Run migration engine in your app
$maintainer = new Maintainer([Entity::class]);
$maintainer->run();

// OR use middleware class
$maintainer = new \SDAM\Middleware\MaintainerMiddleware([\App\Entity\Post::class], $config);
$app->pipe($maintainer);
```

Middleware are constructed with these parameters

- Entities list, **string\[\]**
- $config, **string\[\]**

Usage
-----

[](#usage)

Create your Entity class, Post entity for example :

```
namespace App\Entity;

/**
 * Post
 *
 * @storeName custom_table_name
 */
class Post
{

    /**
     * @length 60
     * @var string
     */
    public $name;

    /**
     * @var string
     */
    public $slug;

    /**
     * @store false
     * @var string
     */
    public $tmp_property;

    /**
     * @text
     * @var string
     */
    public $content;

}
```

(*You can see the list of possible annotations in the class AnnotationsName*)

Just start the migration, either by a simple F5 if you have it enabled in your application (middleware) or other. The table will be created in your database.

Todo
----

[](#todo)

- Manage relationship belongsToMany
- Better manage the tables that already exist when creating (Delete php warning)
- Completed the factory system.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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 ~13 days

Total

6

Last Release

2759d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3fc78794cb1abe661c6b7e265303a06298e880fa503a2dba6d3a95e5c153b61?d=identicon)[TuxBoyBzh](/maintainers/TuxBoyBzh)

---

Top Contributors

[![TuxBoy](https://avatars.githubusercontent.com/u/5089436?v=4)](https://github.com/TuxBoy "TuxBoy (69 commits)")

---

Tags

automaticfastmigrationmysql-databasephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tuxboy-sdam/health.svg)

```
[![Health](https://phpackages.com/badges/tuxboy-sdam/health.svg)](https://phpackages.com/packages/tuxboy-sdam)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[aimeos/aimeos-base

Aimeos base layer for abstracting from host environments

2.1k134.0k1](/packages/aimeos-aimeos-base)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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