Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ jobs:
matrix:
include:
# --prefer-lowest keeps DBAL 3 covered; every other row resolves to DBAL 4.
- php: 8.1
- php: 8.3
composer_update_flags: --prefer-lowest
- php: 8.1
- php: 8.2
- php: 8.3
# Symfony 8 needs PHP 8.4, so this is where that support is actually exercised.
- php: 8.4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 yousign
Copyright (c) 2023-2026 Youtrust

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,41 @@ Make your migrations safe
## 🪄 Features

- PG 13+
- PHP 8.1
- PHP 8.3
- Doctrine Migration

## 🤷 Why?

Because SQL migrations can execute heavy queries on database which can slow down your application.

## ⬆️ Upgrading from `yousign/safe-migrations`

This package was published as `yousign/safe-migrations` up to v1.0.7, under the `Yousign\SafeMigrations\`
namespace. Following the company rename to Youtrust, v2.0.0 moves to `youtrust/safe-migrations` and the
`Youtrust\SafeMigrations\` namespace. There is no functional change between v1.0.7 and v2.0.0.

```shell
$ composer remove yousign/safe-migrations
$ composer req youtrust/safe-migrations:^2.0
```

Then replace every `Yousign\SafeMigrations\` prefix with `Youtrust\SafeMigrations\`. Two spots are easy to
miss because they live in configuration rather than in PHP code:

- the middleware service id in `services.yaml`
- the `use` statement in your `migration.php.tpl` template

`yousign/safe-migrations` is abandoned and no longer maintained. It will receive no further
release of any kind, security fixes included. Upgrade to `youtrust/safe-migrations`.

## ⚙️ Config

_*For Symfony 6.4, 7.x or 8.x, with Doctrine DBAL 3 or 4_

Install in your project

```shell
$ composer req yousign/safe-migrations
$ composer req youtrust/safe-migrations
```

Declare the Middleware in your `services.yaml`
Expand All @@ -29,7 +49,7 @@ parameters:
env(ENABLE_RETRY_LOCK_TIMEOUT): false

services:
Yousign\SafeMigrations\Doctrine\DBAL\Driver\Middleware\RetryLockTimeoutMiddleware:
Youtrust\SafeMigrations\Doctrine\DBAL\Driver\Middleware\RetryLockTimeoutMiddleware:
$isEnabled: '%env(bool:ENABLE_RETRY_LOCK_TIMEOUT)%'
```

Expand All @@ -43,7 +63,7 @@ declare(strict_types=1);
namespace <namespace>;

use Doctrine\DBAL\Schema\Schema;
use Yousign\SafeMigrations\Doctrine\Migration;
use Youtrust\SafeMigrations\Doctrine\Migration;

class <className> extends Migration
{
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "yousign/safe-migrations",
"name": "youtrust/safe-migrations",
"description": "Make your migrations safe",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Benoit Galati",
"email": "benoit.galati@yousign.com"
"email": "benoit.galati@youtrust.com"
},
{
"name": "Nicolas Dousson",
"email": "nicolas.dousson@yousign.com"
"email": "nicolas.dousson@youtrust.com"
}
],
"autoload": {
"psr-4": {
"Yousign\\SafeMigrations\\": "src"
"Youtrust\\SafeMigrations\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Yousign\\SafeMigrations\\Tests\\": "tests"
"Youtrust\\SafeMigrations\\Tests\\": "tests"
}
},
"config": {
Expand All @@ -32,7 +32,7 @@
}
},
"require": {
"php": "^8.1",
"php": "^8.3",
"doctrine/dbal": "^3.7|^4.0",
"doctrine/migrations": "^3.6",
"symfony/string": "^6.4|^7.0|^8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Doctrine\DBAL\Driver\Middleware;
namespace Youtrust\SafeMigrations\Doctrine\DBAL\Driver\Middleware;

use Doctrine\DBAL\Driver\Exception as DriverException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Doctrine\DBAL\Driver\Middleware;
namespace Youtrust\SafeMigrations\Doctrine\DBAL\Driver\Middleware;

use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\Exception as DriverException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Doctrine\DBAL\Driver\Middleware;
namespace Youtrust\SafeMigrations\Doctrine\DBAL\Driver\Middleware;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Doctrine\DBAL\Driver\Middleware;
namespace Youtrust\SafeMigrations\Doctrine\DBAL\Driver\Middleware;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\Middleware;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Doctrine;
namespace Youtrust\SafeMigrations\Doctrine;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Schema;
Expand Down
4 changes: 2 additions & 2 deletions tests/Database/Doctrine/Migrations/MigrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yousign\SafeMigrations\Tests\Database\Doctrine\Migrations;
namespace Youtrust\SafeMigrations\Tests\Database\Doctrine\Migrations;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Schema;
Expand All @@ -12,7 +12,7 @@
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Yousign\SafeMigrations\Doctrine\Migration;
use Youtrust\SafeMigrations\Doctrine\Migration;

final class MigrationTest extends TestCase
{
Expand Down
Loading