Download the PHP package myaghobi/f3-migrations without Composer
On this page you can find all versions of the php package myaghobi/f3-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download myaghobi/f3-migrations
More information about myaghobi/f3-migrations
Files in myaghobi/f3-migrations
Package f3-migrations
Short Description A database helper plugin for the Fat-Free framework.
License GPL-3.0
Homepage https://github.com/myaghobi/f3-migrations
Informations about the package f3-migrations
F3-Migrations
F3-Migrations is a database helper plugin for the Fat-Free Framework.
It'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.
- F3-Migrations
- Installation
- Operation and basic usage
- Instantiate
- First migration
- Config
- Logging
- CLI mode
- Upgrade
- License
Installation
If you use composer, run the below code:
For manual installation:
- Copy the content of
lib/
folder into yourlib/
folder. - Install Schema Builder as mentioned in its documentation.
- Install Html2Text, by placing the
html2text.php
inside of a folder namedhtml2text
in yourlib/
.
Operation and basic usage
The plugin provides a simple web interface, consists of 4 routes that will auto add to your app:
GET /migrations
displays the web interfaceGET /migrations/@action
triggers an actionGET /migrations/@action/@target
specific target version for the actionGET /migrations/theme/@type/@file
to retrive css/js files if you have stored the UI dir in non-web-accessible path (recommended)
Also, it will create a table in your database named migrations
to handle migrations.
Instantiate
Instantiate the Migrations
class before f3->run()
. The plugin works if DEBUG>=3
, otherwise, it goes disable because of security issues and to get no resource usage.
To work with Migrations
you need an active SQL connection:
First migration
- Make sure the path of your cases directory be exists and secure.
- Call
yourAppPublicUrl/migrations
in browser. - Use
makecase
action to make your first migration case. - Call
migrate
action.
Config
This plugin is configurable via config file:
The above config is the default, you can ignore/remove each one you don't need to change.
Logging
You can find the logs of actions in migrations.log
located in the LOGS folder.
CLI mode
Just run the below code:
Upgrade
- First update the plugin via composer or manually.
- Now the path of migration cases is relative to
index.php
, so make sure it be exists. - Make a backup of your DB and migration cases.
- Call
upgrademc
action to update the old migration cases.
Finally call fresh
action.
License
You are allowed to use this plugin under the terms of the GNU General Public License version 3 or later.
Copyright (C) 2021 Mohammad Yaghobi
All versions of f3-migrations with dependencies
ikkez/f3-schema-builder Version ^2.2.4
html2text/html2text Version ^4.3.1