From 65ff637a264aaa5f0ea07b63f74f9a6077f4dbdb Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Tue, 22 Sep 2020 11:36:31 +0200 Subject: [PATCH 1/3] README updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af80a55..ae57a04 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![Quality Score](https://img.shields.io/scrutinizer/g/orkhanahmadov/content-migrations.svg)](https://scrutinizer-ci.com/g/orkhanahmadov/content-migrations) [![StyleCI](https://github.styleci.io/repos/297263051/shield?branch=master)](https://github.styleci.io/repos/297263051?branch=master) -Package simplifies having content based migrations separate from Laravel's migrations. +Package simplifies having content-based migrations separate from Laravel's migrations. ## Why? From b9cee53a40891621610a604f178a6d803369a3c9 Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Tue, 22 Sep 2020 11:37:30 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae57a04..794d56d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Package simplifies having content-based migrations separate from Laravel's migra ## Why? -Sometimes using migrations to manage content in database tables comes very handy to automate the content update process on all environments. Like adding new translations or product. +Sometimes using migrations to manage content in database tables comes very handy to automate the content update process on all environments. Like adding new translations or updating products. + But using Laravel's own migrations for this purpose have some drawback: * Laravel's migrations are not meant for content management, it is meant for database structure changes only. @@ -42,7 +43,7 @@ composer require orkhanahmadov/content-migrations To create content-based migration run `make:content-migration` artisan command and pass migration name: ``` shell script -php artisan make:content-migration add_new_post +php artisan make:content-migration add_new_translations ``` This will command will generate timestamp-based content migration inside `database/content-migrations` folder of your application. From b6c2489be8c4f935b1b498ef9fbefb0e8c64c18a Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Tue, 22 Sep 2020 13:59:02 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 794d56d..4c49ad1 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ But using Laravel's own migrations for this purpose have some drawback: * After some time it gets hard to manage and find content-based migrations among many migration files. * Recent introduction of "migration squashing" in Laravel 8 copies last state of database structure only. This means if you have content-based migrations you need to find a way to migrate them again if you have an empty database. +Laravel seeders are ideal for managing content in your database, but they also have their drawbacks: + +* They are not as automatic as migrations, you need to run and track each of them individually +* If you have an empty datatabase it becomes hard, almost impossible to know the order of seeders to run + This package aims to solve these problems by having dedicated content-based migrations separate from usual Laravel migrations. ## Requirements