{"id":16467242,"url":"https://github.com/norgul/laravel-data-migrations","last_synced_at":"2026-04-14T02:31:34.127Z","repository":{"id":63165036,"uuid":"565381199","full_name":"Norgul/laravel-data-migrations","owner":"Norgul","description":"Laravel support for data migrations","archived":false,"fork":false,"pushed_at":"2022-11-14T06:47:12.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T17:31:10.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Norgul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-13T08:07:00.000Z","updated_at":"2022-11-14T06:32:34.000Z","dependencies_parsed_at":"2022-11-14T08:43:24.248Z","dependency_job_id":null,"html_url":"https://github.com/Norgul/laravel-data-migrations","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Flaravel-data-migrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Flaravel-data-migrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Flaravel-data-migrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Flaravel-data-migrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Norgul","download_url":"https://codeload.github.com/Norgul/laravel-data-migrations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241052226,"owners_count":19900984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T11:46:41.590Z","updated_at":"2026-04-14T02:31:34.117Z","avatar_url":"https://github.com/Norgul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Data Migrations\n\nThis package is used to deliver seamless data migrations to Laravel. Data migrations are version control system\nfor your mandatory DB data (like statuses, types, etc.) without which the app wouldn't function.\n\nOne alternative is to burn these within your plain migrations, other is just to use seeders at which point\nyou need to devise a mechanism to split production grade seeders from the development ones.\n\nThese are all good solutions as long as you follow some methodology and are consistent. The goal of this \npackage was to deliver a real separation for this use case.\n\n# Installation\n\nRequire the package with ``composer require norgul/laravel-data-migrations``.\nService provider will be registered automatically.\n\n# Usage\n\nYou can start using the package by running commands below which are following Laravel ``migration`` command\nstructure with, for the most part, the same API they provide. \n\nRemember you can add ``-h`` flag to show all available options for a particular command.\n\n# Commands\n## Make Data Migration\n\n``php artisan make:data-migration {name}`` \n\nCreate your first data migration. This will create `data-migrations` directory in your ``database`` \ndirectory if it doesn't already exist, which is the place where you'll find already familiar naming structure.\n\nPackage is using Laravel migrator in the background, so if you run:\n```\nphp artisan make:data-migration add_user_types_to_users_table\n```\n\nThe table guesser will automatically add a data migration with ``users`` table stubbed in. \n\nEven though you can reference Eloquent classes and even your seeders from within data migrations, it is \n**highly recommended** to use ``DB`` facade to execute queries. Reason behind it is that your classes and seeders may\nchange over time, thus leaving your data migrations execute differently in the future. Always using ``DB``\nfacade will ensure that end results are always the same.\n\n## Data Migrate\n\n``php artisan data-migrate``\n\nExecute your migrations with ``data-migrate`` command. These will be executed once, in the same way as standard\nmigrations are ran (by executing `up()` function).\n\nCommand will automatically create ``data_migrations`` table in the DB if it doesn't already exist.\n\n## Data Migrate Rollback\n\n``php artisan data-migrate:rollback``\n\nYou can revert your changes by executing this command which will trigger ``down()`` function in the data migration.\n\n## Data Migrate Install\n\n``php artisan data-migrate:install``\n\nYou never need to run this command explicitly. It is here for documentation purposes.\n\nThis command will create ``data_migrations`` table in your DB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorgul%2Flaravel-data-migrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorgul%2Flaravel-data-migrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorgul%2Flaravel-data-migrations/lists"}