Skip to content

Commit 95c100e

Browse files
committed
docs: readme changed.
1 parent f51baf0 commit 95c100e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ seamless integration into both legacy and modern Laravel projects (Laravel 5–1
3030
- 🧱 Extensible design via modular definition/mapping architecture
3131
- 🧩 Supports Laravel 5 to 12 (EOL versions maintained in read‑only mode)
3232
- 🛠 Clean, testable and maintainable codebase
33+
- 🧠 Optional schema normalization (via `--normalizer=`), including:
34+
- Synthetic primary keys for legacy tables with composite keys
35+
- Automatic preservation of uniqueness constraints
36+
- Better Eloquent compatibility for complex schemas
3337

3438
## 🔍 Feature Comparison
3539

@@ -155,6 +159,33 @@ Laravel and can be reused, extended, or mapped differently.
155159
These classes transform the internal representation into **valid Laravel migration code** (PHP). You can override them
156160
to adjust formatting, naming conventions, or structure.
157161

162+
## 🧰 Schema Normalizers
163+
164+
Schema Normalizers are optional pre-processing steps that transform your database schema before migration generation.
165+
They can help adapt legacy structures for better Laravel compatibility.
166+
167+
### Available Normalizers
168+
169+
| Normalizer | Description |
170+
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
171+
| `pivot` | Replaces composite primary keys with a synthetic auto-incrementing `id()` column and converts the original composite key into a named `unique()` constraint. Useful for legacy tables incompatible with Eloquent. |
172+
173+
### Usage
174+
175+
Enable a normalizer via CLI:
176+
177+
```bash
178+
php artisan migrate:regenerate --normalizer=synthetic_pk
179+
```
180+
181+
Or configure it in `config/migration-generator.php`:
182+
183+
```php
184+
'normalizer' => [
185+
'enabled' => ['pivot'],
186+
],
187+
```
188+
158189
## 🧪 Testing
159190

160191
To run the tests:

0 commit comments

Comments
 (0)