{"id":13623510,"url":"https://github.com/icomefromthenet/Migrations","last_synced_at":"2025-04-15T14:33:20.798Z","repository":{"id":2570436,"uuid":"3550431","full_name":"icomefromthenet/Migrations","owner":"icomefromthenet","description":"php 5.3 Migration Manager","archived":false,"fork":false,"pushed_at":"2016-10-06T22:19:31.000Z","size":4542,"stargazers_count":40,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-01T21:56:58.746Z","etag":null,"topics":[],"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/icomefromthenet.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":"2012-02-26T07:01:18.000Z","updated_at":"2023-10-03T04:56:01.000Z","dependencies_parsed_at":"2022-09-07T10:41:53.390Z","dependency_job_id":null,"html_url":"https://github.com/icomefromthenet/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/icomefromthenet%2FMigrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icomefromthenet%2FMigrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icomefromthenet%2FMigrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icomefromthenet%2FMigrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icomefromthenet","download_url":"https://codeload.github.com/icomefromthenet/Migrations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223677654,"owners_count":17184519,"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-08-01T21:01:32.579Z","updated_at":"2024-11-08T11:30:57.180Z","avatar_url":"https://github.com/icomefromthenet.png","language":"PHP","funding_links":[],"categories":["Table of Contents","迁移","目录","PHP","迁移 Migrations","ORM and Datamapping","Migrations","迁移( Migrations )"],"sub_categories":["Migrations","迁移 Migrations","Library"],"readme":"#What are Database Migrations?\n\nMigrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run them. You’d also have to keep track of which changes need to be run against the production machines next time you deploy.\n\nAbove from [Rails guide](http://guides.rubyonrails.org/migrations.html).\n\nThis Migrations library was inspired by earlier works such as [mysql-php-migrations](https://github.com/davejkiger/mysql-php-migrations),\nand implementations found in both Codeigniter and Fulephp frameworks.\n\n##Whats different?\n\n1. Written with php 5.3 and uses [Symfony2](http://symfony.com/components) components and [Doctrine DBAL](http://www.doctrine-project.org/projects/dbal.html)\n2. Allows each project to define templates using [Twig](http://twig.sensiolabs.org/).\n3. Uses Doctrine DBAL Schema manager to write platform independent migrations or use normal SQL DDL to control your database.\n4. All commands accept a [DSN](http://en.wikipedia.org/wiki/Data_Source_Name) allowing scripting to apply your migrations to many databases.\n\n##Getting Started\n\n###Installing\n\nThis library can be accessed through Composer\n\nUsing dev mode as most likely don't want this component in a release cycle.\n\nCreate composer.json add add the following.\n\n```json\n{\n    \"require\" : {\n    },\n    \"require-dev\" : {\n        \"icomefromthenet/migration\" : \"dev-master\" \n    }\n }\n```\n\n##Running the commands\n\n***Create the project folder and then run the int function using the vendor bin migrate.php. Note all commands are prefixed with `app:`***\n\n    mkdir migrations\n    cd migrations\n    ../vendor/bin/migrate.php app:init \n\n***Create the Config for your database answer the questions and a config will be created.***\n\n    ../vendor/bin/migrate.php app:config \n\n***Run install to add migrations tacking database table to the schema:***\n\n    ../vendor/bin/migrate.php app:install \n\n***Add your first migration by using the add command (optional description slug):***\n\n    ../vendor/bin/migrate.php app:add #prefix# \n\n***Run up command to install the change***\n\n    ../vendor/bin/migrate.php app:up 1\n\n***Run status to find the head migration***\n\n    ../vendor/bin/migrate.php app:status\n\n***Run status to find the head migration***\n\n    ../vendor/bin/migrate.php app:status\n\n\nRequirements\n----------------\n\n* php 5.3\n* CLI.\n* SPL\n* PDO\n* Composer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficomefromthenet%2FMigrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficomefromthenet%2FMigrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficomefromthenet%2FMigrations/lists"}