Tina4Stack  v1.0.1
The Tina4 Stack
Maggy Class Reference

Public Member Functions

 __construct ($migrationPath="migration", $delim=";", $runMigrations=false)
 
 doMigration ()
 
 createMigration ()
 
 getPageTemplate ($title="Default")
 
 updateMigration ()
 

Detailed Description

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.

Constructor & Destructor Documentation

Maggy::__construct (   $migrationPath = "migration",
  $delim = ";",
  $runMigrations = false 
)

Constructor for Maggy

There needs to be a Ruth Object DEB for the database declared using the Debby Class The path is relative to your web folder.

Parameters
String$migrationPathrelative path to your web folder
String$delimA delimiter to say how your SQL is run

Member Function Documentation

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

Parameters
type$titleString A title to name the page by
Returns
type Shape A page template with default bootstrap
Maggy::updateMigration ( )

The documentation for this class was generated from the following file: