![]() |
Tina4Stack
v1.0.1
The Tina4 Stack
|
Public Member Functions | |
__construct ($migrationPath="migration", $delim=";", $runMigrations=false) | |
doMigration () | |
createMigration () | |
getPageTemplate ($title="Default") | |
updateMigration () | |
Description of Maggy
Maggy makes migrating of your database a breeze, all you need to do is make a migration folder in your web root and create files in the following format
There are some "rules" that Maggy prescribes for the migrations and it would be in your best interests to follow them. 1.) File formats are in the following format: YYYYMMDDHHMMSS Description of migration followed by dot sql Example: 01012015101525 The first migration.sql 2.) Do not put commit statements in the SQL, this will make it impossible for a migration to fail or roll back. Instead make more files. A create table statement would be in its own file. 3.) Stored procedures, triggers and views should be in their own files, they are run as individual statements and are commited so, delimter is not needed on the end of these. You do not need to change the delimiter either before running these statements.
Maggy::__construct | ( | $migrationPath = "migration" , |
|
$delim = ";" , |
|||
$runMigrations = false |
|||
) |
Maggy::createMigration | ( | ) |
Maggy::doMigration | ( | ) |
Do Migration
Do Migration finds the last possible migration based on what is read from the database on the constructor It then opens the migration file, imports it into the database and tries to run each statement. The migration files must run in sequence and Maggy will stop if she hits an error!
DO NOT USE COMMIT STATEMENTS IN YOUR MIGRATIONS , RATHER BREAK THINGS UP INTO SMALLER LOGICAL PIECES
Maggy::getPageTemplate | ( | $title = "Default" | ) |
The default page template for maggy
type | $title | String A title to name the page by |
Maggy::updateMigration | ( | ) |