{"id":18376445,"url":"https://github.com/cycle/migrations","last_synced_at":"2025-09-11T06:36:53.021Z","repository":{"id":34241810,"uuid":"172721727","full_name":"cycle/migrations","owner":"cycle","description":"Automatic migration generation","archived":false,"fork":false,"pushed_at":"2025-07-12T13:45:24.000Z","size":430,"stargazers_count":21,"open_issues_count":14,"forks_count":16,"subscribers_count":4,"default_branch":"4.x","last_synced_at":"2025-07-12T15:32:28.075Z","etag":null,"topics":["cycle","hacktoberfest","migrations","orm","php"],"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/cycle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-26T13:56:44.000Z","updated_at":"2025-05-27T05:46:37.000Z","dependencies_parsed_at":"2023-02-12T09:45:28.964Z","dependency_job_id":"f3b6fbcb-a493-46e1-9ea0-d6ba03f4444e","html_url":"https://github.com/cycle/migrations","commit_stats":{"total_commits":120,"total_committers":16,"mean_commits":7.5,"dds":"0.45833333333333337","last_synced_commit":"351e0be53e57c9f04816558953646177ea8b7934"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/cycle/migrations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle%2Fmigrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle%2Fmigrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle%2Fmigrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle%2Fmigrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycle","download_url":"https://codeload.github.com/cycle/migrations/tar.gz/refs/heads/4.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle%2Fmigrations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274589627,"owners_count":25312971,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cycle","hacktoberfest","migrations","orm","php"],"created_at":"2024-11-06T00:23:21.321Z","updated_at":"2025-09-11T06:36:52.977Z","avatar_url":"https://github.com/cycle.png","language":"PHP","readme":"# Cycle Database Migrations\n\n[![Latest Stable Version](https://poser.pugx.org/cycle/migrations/v/stable)](https://packagist.org/packages/cycle/migrations)\n[![Build Status](https://github.com/cycle/migrations/workflows/build/badge.svg)](https://github.com/cycle/migrations/actions)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cycle/migrations/badges/quality-score.png?b=4.x)](https://scrutinizer-ci.com/g/cycle/migrations/?branch=4.x)\n[![Codecov](https://codecov.io/gh/cycle/migrations/branch/4.x/graph/badge.svg)](https://codecov.io/gh/cycle/migrations/)\n\nMigrations are a convenient way for you to alter your database in a structured and organized manner. This package adds\nadditional functionality for versioning your database schema and easily deploying changes to it. It is a very easy to\nuse and a powerful tool.\n\n## Installation\n\n```bash\ncomposer require cycle/migrations ^4.0\n```\n\n## Configuration\n\n```php\nuse Cycle\\Migrations;\nuse Cycle\\Database;\nuse Cycle\\Database\\Config;\n\n$dbal = new Database\\DatabaseManager(new Config\\DatabaseConfig([\n    'default' =\u003e 'default',\n    'databases' =\u003e [\n        'default' =\u003e [\n            'connection' =\u003e 'sqlite'\n        ]\n    ],\n    'connections' =\u003e [\n        'sqlite' =\u003e new Config\\SQLiteDriverConfig(\n            connection: new Config\\SQLite\\MemoryConnectionConfig(),\n            queryCache: true,\n        ),\n    ]\n]));\n\n$config = new Migrations\\Config\\MigrationConfig([\n    'directory' =\u003e __DIR__ . '/../migrations/',    // where to store migrations\n    'vendorDirectories' =\u003e [                       // Where to look for vendor package migrations\n        __DIR__ . '/../vendor/vendorName/packageName/migrations/'\n    ],\n    'table' =\u003e 'migrations'                       // database table to store migration status\n    'safe' =\u003e true                                // When set to true no confirmation will be requested on migration run. \n]);\n\n$migrator = new Migrations\\Migrator(\n    $config, \n    $dbal, \n    new Migrations\\FileRepository($config)\n);\n\n// Init migration table\n$migrator-\u003econfigure();\n```\n\n## Running\n\n```php\nwhile (($migration = $migrator-\u003erun()) !== null) {\n    echo 'Migrate ' . $migration-\u003egetState()-\u003egetName();\n}\n```\n\n## Generate Migrations\n\nYou can automatically generate a set of migration files during schema compilation. In this case, you have the freedom to\nalter such migrations manually before running them. To achieve that you must install\nthe [Schema migrations generator extension](https://github.com/cycle/schema-migrations-generator).\n\n## License:\n\nMIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained\nby [Spiral Scout](https://spiralscout.com).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycle%2Fmigrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycle%2Fmigrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycle%2Fmigrations/lists"}