{"id":13520144,"url":"https://github.com/drfraker/snipe-migrations","last_synced_at":"2026-01-13T23:46:49.510Z","repository":{"id":47005110,"uuid":"171511006","full_name":"drfraker/snipe-migrations","owner":"drfraker","description":"Blazing fast database migrations for Laravel tests.","archived":false,"fork":false,"pushed_at":"2023-04-18T17:46:30.000Z","size":55,"stargazers_count":289,"open_issues_count":11,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-07T22:58:26.530Z","etag":null,"topics":["laravel","migrations","testing"],"latest_commit_sha":null,"homepage":"","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/drfraker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-19T16:40:09.000Z","updated_at":"2025-02-11T21:34:29.000Z","dependencies_parsed_at":"2024-01-18T05:23:31.692Z","dependency_job_id":"a6c9498d-a7f3-4bfb-a944-bfb7cd18d0da","html_url":"https://github.com/drfraker/snipe-migrations","commit_stats":{"total_commits":55,"total_committers":14,"mean_commits":"3.9285714285714284","dds":0.2909090909090909,"last_synced_commit":"2f79b5c49a9649a8a8198763c84bcb7743b5ffbb"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/drfraker/snipe-migrations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drfraker%2Fsnipe-migrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drfraker%2Fsnipe-migrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drfraker%2Fsnipe-migrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drfraker%2Fsnipe-migrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drfraker","download_url":"https://codeload.github.com/drfraker/snipe-migrations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drfraker%2Fsnipe-migrations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["laravel","migrations","testing"],"created_at":"2024-08-01T05:02:12.602Z","updated_at":"2026-01-13T23:46:49.491Z","avatar_url":"https://github.com/drfraker.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"![build status](https://travis-ci.com/drfraker/snipe-migrations.svg?branch=master \"build status\")\n![StyleCI](https://github.styleci.io/repos/171511006/shield?branch=master)\n\n# Snipe Migrations\n\nBlazing fast database migrations for Laravel tests. \n\nThe package takes a snapshot of your mysql database and imports the schema to your test database rather than running \nall of your migrations when the test suite starts up. \n\nIf you have a project with many migration files, this process can provide you with a massive speed improvement when \ninitializing your test suite. This package can be used as a replacement for the RefreshDatabase trait that is provided out\nof the box with Laravel.\n\nAs an example, we tested this on an application that takes about 4 seconds to run all migrations with RefreshDatabase. \nUsing SnipeMigrations the tests start up in 200 ms.\n\n## Requirements\n1. Laravel \u003e= 5.5\n2. PHP \u003e= 7.1\n3. MySql or MariaDb, with separate database for testing.\n\t- For example if you have a development database for your application called `amazingapp`\n\tyou would create a test database called `amazingapp_test` and add the details of the \n\tdatabase in your phpunit.xml file. `amazingapp_test` is the database that Snipe will keep in sync for you.\n\n## Installation\n\nRequire the package using composer.\n\n```bash\ncomposer require --dev drfraker/snipe-migrations\n```\n\n## Usage\n\n**After you've installed the package via composer**\n1. Add the `SnipeMigrations` trait to your `tests/TestCase` file. Don't forget to import the class at the top of the file. Once you have added the `SnipeMigrations` trait, simply use the RefreshDatabase trait in any tests in which you wish to use database access, and Snipe will handle the rest for you.\n\nWhen you're done, your `tests/TestCase.php` file should look like this.\n\n```php\n\u003c?php\n\nnamespace Tests;\n\nuse Drfraker\\SnipeMigrations\\SnipeMigrations;\nuse Illuminate\\Foundation\\Testing\\TestCase as BaseTestCase;\n\nabstract class TestCase extends BaseTestCase\n{\n    use CreatesApplication, SnipeMigrations;\n}\n```\n\n2. By default, SnipeMigrations will store a `.snipe` file and the `snipe_snapshot.sql` file in `/vendor/drfraker/snipe-migrations/snapshots`. If you would like to change the location of the files follow the directions below to publish\nthe snipe config file.\n\t- To publish the snipe config file, run `php artisan vendor:publish` and select `snipe-config` from the list.\n\n3. If the snipe_snapshot.sql file gets out of sync for any reason you can clear it by running `php artisan snipe:clear`. After running\nthis command your original database migrations will run again creating a new `snipe_snapshot.sql` file.\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrfraker%2Fsnipe-migrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrfraker%2Fsnipe-migrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrfraker%2Fsnipe-migrations/lists"}