Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skipthedragon/wp-migrations
✨ WordPress migrations for plugins.
https://github.com/skipthedragon/wp-migrations
migrations-runner php wordpress
Last synced: about 2 months ago
JSON representation
✨ WordPress migrations for plugins.
- Host: GitHub
- URL: https://github.com/skipthedragon/wp-migrations
- Owner: SkipTheDragon
- License: apache-2.0
- Created: 2024-02-06T10:37:45.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-10T19:34:49.000Z (9 months ago)
- Last Synced: 2024-08-23T18:04:04.621Z (5 months ago)
- Topics: migrations-runner, php, wordpress
- Language: PHP
- Homepage: https://wyverr.com
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## WordPress Migration
Heavily inspired by Symfony/Doctrine migrations, this package provides a simple way to manage your WordPress database schema and data.
### Installation
```bash
composer require skipthedragon/wp-migrations
```### Pre-requisites
This package requires:
- `wpdb` (WordPress database)
- at least PHP 8.1### Prerequisites
Migrations must:
- be in the migration folder that you specified in the config
- have a unique timestamp in its name
- implement the Migration interface (`WpMigrations\Architecture\Migration`)
- have `MigrationV` in its name### Usage
To run the migrations, you can use the following code:
```php
use WpMigrations\service\MigrationManagerService;
$config = new \WpMigrations\Architecture\MigrationConfig(
'path/to/migrations',
'WpMigrations\\Migrations\\',
'my_plugin_name'
);
$migrationManagerService = new MigrationManagerService($config);
$migrationManagerService->migrate();
```Check the `migrate()` method in `service/MigrationManagerService.php` for more options and types of migration.