From 15f0e49d8b1e3263c52ee63977a3d399fa654c0d Mon Sep 17 00:00:00 2001
From: Bart Jaskulski <bartek.jaskulski@wpdesk.net>
Date: Mon, 12 Dec 2022 16:33:10 +0100
Subject: [PATCH] chore: add simple readme description

Signed-off-by: Bart Jaskulski <bartek.jaskulski@wpdesk.net>
---
 README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/README.md b/README.md
index e69de29..1ef0095 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,44 @@
+# WP Migrations
+
+Simple library based on `doctrine/migrations` for managing database
+versioned schema.
+
+## Installation
+
+`composer require wpdesk/wp-migrations`
+
+## Usage
+
+To operate on WordPress database you need to create class extending
+`WPDesk\Migrations\AbstractMigration`.
+
+```php
+$migrator = WpdbMigrator::from_classes(
+  [Version_01012022::class, Version_12012022::class],
+  'unique_db_option_name'
+);
+$migrator->migrate();
+```
+
+With multiple migration sources it may be inconvenient to type each class in array. In such case it may be better to group all migrations in directories. In such case it is required that (besides each class MUST extend `WPDesk\Migrations\AbstractMigration` class) file names starting with **Version** prefix.
+
+Assuming following directory structure:
+
+```
+project\
+  migrations\
+    Version_01012022.php
+    Version_12012022.php
+    XVersion_13012022.php # This will be skipped
+  main.php
+```
+
+You can register your migration classes in the following way:
+
+```php
+$migrator = WpdbMigrator::from_directories(
+  [__DIR__ . '/migrations'],
+  'unique_db_option_name'
+);
+$migrator->migrate();
+```
-- 
GitLab