{"id":16314268,"url":"https://github.com/myaaghubi/f3-migrations","last_synced_at":"2025-08-22T02:05:01.727Z","repository":{"id":48891219,"uuid":"305648512","full_name":"myaaghubi/f3-migrations","owner":"myaaghubi","description":"F3-Migrations is a database helper plugin for the Fat-Free framework.","archived":false,"fork":false,"pushed_at":"2025-07-17T12:09:54.000Z","size":147,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-22T02:02:17.962Z","etag":null,"topics":["database","database-migrations","f3-migrations","fat-free-framework","fat-free-plugin","migration","sql"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myaaghubi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-20T08:57:40.000Z","updated_at":"2025-07-31T06:53:45.000Z","dependencies_parsed_at":"2025-07-17T17:11:01.937Z","dependency_job_id":"12a54152-91de-4f15-a39c-a435bc341731","html_url":"https://github.com/myaaghubi/f3-migrations","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/myaaghubi/f3-migrations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2Ff3-migrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2Ff3-migrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2Ff3-migrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2Ff3-migrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myaaghubi","download_url":"https://codeload.github.com/myaaghubi/f3-migrations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myaaghubi%2Ff3-migrations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271574431,"owners_count":24783319,"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-08-22T02:00:08.480Z","response_time":65,"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":["database","database-migrations","f3-migrations","fat-free-framework","fat-free-plugin","migration","sql"],"created_at":"2024-10-10T21:53:37.490Z","updated_at":"2025-08-22T02:05:01.667Z","avatar_url":"https://github.com/myaaghubi.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F3-Migrations\nF3-Migrations is a database helper plugin for the [Fat-Free Framework](http://github.com/bcosca/fatfree).\nIt's something like version control for the sql databases. Every time you have to make some changes manually in your database, you can make a `MigrationCase`, and the plugin will handle that.\n\n\n- [F3-Migrations](#f3-migrations)\n  - [Installation](#installation)\n  - [Operation and basic usage](#operation-and-basic-usage)\n    - [Instantiate](#instantiate)\n    - [First migration](#first-migration)\n    - [Config](#config)\n    - [Logging](#logging)\n    - [CLI mode](#cli-mode)\n  - [Upgrade](#upgrade)\n  - [License](#license)\n\n## Installation\n\nIf you use composer, run the below code:\n\n```\ncomposer require myaghobi/f3-migrations\n```\nFor manual installation:\n1. Copy the content of `lib/` folder into your `lib/` folder. \n2. Install [Schema Builder](https://github.com/ikkez/f3-schema-builder) as mentioned in its documentation.\n3. Install [Html2Text](https://github.com/mtibben/html2text), by placing the `html2text.php` inside of a folder named `html2text` in your `lib/`.\n\n\n## Operation and basic usage\n\nThe plugin provides a simple web interface, consists of 4 routes that will auto add to your app:\n\n* `GET /migrations` displays the web interface\n* `GET /migrations/@action` triggers an action\n* `GET /migrations/@action/@target` specific target version for the action\n* `GET /migrations/theme/@type/@file` to retrive css/js files if you have stored the UI dir in non-web-accessible path (recommended)\n\nAlso, it will create a table in your database named `migrations` to handle migrations.\n\n### Instantiate\n\nInstantiate the `Migrations` class before `f3-\u003erun()`. The plugin works if `DEBUG\u003e=3`, otherwise, it goes disable because of security issues and to get no resource usage. \nTo work with `Migrations` you need an active SQL connection:\n\n```php\n// require('vendor/autoload.php');\n// $f3=Base::instance();\n$f3=require('lib/base.php');\n...\n// Acording to f3-schema-builder\n// MySQL, SQLite, PostgreSQL \u0026 SQL Server are supported\n$db = new \\DB\\SQL('mysql:host=localhost;port=3306;dbname='.$DBName, $user, $pass);\n...\n\\DB\\MIGRATIONS\\Migrations::instance($db);\n$f3-\u003erun();\n```\n\n### First migration\n\n1. Make sure the path of your cases directory be exists and secure.\n2. Call `yourAppPublicUrl/migrations` in browser. \n3. Use `makecase` action to make your first migration case.\n4. Call `migrate` action.\n\n\n### Config\nThis plugin is configurable via config file:\n``` ini\n[migrations]\nENABLE=true\n; PATH relative to `index.php`\nPATH=../migrations\nSHOW_BY_VERSOIN=true\nCASE_PREFIX=migration_case_\nLOG=true\n```\nThe above config is the default, you can ignore/remove each one you don't need to change.\n\n### Logging\n\nYou can find the logs of actions in `migrations.log` located in the [LOGS](http://fatfreeframework.com/quick-reference#LOGS) folder.\n\n### CLI mode\n\nJust run the below code:\n```\nphp index.php /migrations\n```\n\n## Upgrade\n\n1. First update the plugin via composer or manually.\n2. Now the path of migration cases is relative to `index.php`, so make sure it be exists. \n3. Make a backup of your DB and migration cases.\n4. Call `upgrademc` action to update the old migration cases.\n\nFinally call `fresh` action.\n\n## License\n\nYou are allowed to use this plugin under the terms of the GNU General Public License version 3 or later.\n\nCopyright (C) 2021 Mohammad Yaghobi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyaaghubi%2Ff3-migrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyaaghubi%2Ff3-migrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyaaghubi%2Ff3-migrations/lists"}