PHP 클래스 FromMySqlToPostgreSql, FromMySqlToPostgreSql

저자: Anatoly Khaytovich
파일 보기 프로젝트 열기: AnatolyUss/FromMySqlToPostgreSql 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $arrConfig ) Constructor.
__destruct ( ) Destructor.
migrate ( ) : void Performs migration from source database to destination database.

비공개 메소드들

메소드 설명
arrangeColumnsData ( array $arrColumns ) : string Arranges columns data before loading.
connect ( ) : void Check if both servers are connected.
createAndPopulateTables ( ) : boolean Create tables with the basic structure (column names and data types).
createConstraints ( ) Set table constraints.
createForeignKeysAndRunVacuumFullAndAnalyze ( ) Set foreign key constraints, then run "vacuum full" and "ANALYZE" for each table.
createSchema ( ) : boolean Create a new database schema.
createSequence ( string $strTableName, array $arrColumns ) : void Define which column in given table has the "auto_increment" attribute.
createTable ( string $strTableName ) : boolean Migrate structure of a single table to PostgreSql server.
createView ( string $strViewName ) : void Migrate given view to PostgreSql server.
createViews ( ) Attempt to create views.
extractDbName ( string $strConString ) : string Extract database name from given query-string.
generateError ( PDOException $e, string $strMessage, string $strSql = '' ) : void Writes a ditailed error message to the log file, if specified.
generateReport ( ) : string Generates a summary report.
loadStructureToMigrate ( ) : boolean Load MySql tables, that need to be migrated into an array.
log ( string $strLog, boolean $boolIsError = false ) : void Outputs given log.
populateTable ( string $strTableName ) : integer Populate current table.
populateTableWorker ( string $strTableName, string $strSelectFieldList, integer $intOffset, integer $intRowsInChunk, integer $intRowsCnt, integer $intForNowInserted ) : integer Load a chunk of data using "PostgreSql COPY".
processComment ( string $strTableName, array $arrColumns ) : void Create comments.
processDefault ( string $strTableName, array $arrColumns ) : void Define which columns of the given table have default value.
processEnum ( string $strTableName, array $arrColumns ) : void Define which columns of the given table are of type "enum".
processForeignKey ( string $strTableName ) : void Create foreign keys.
processIndexAndKey ( string $strTableName, array $arrColumns ) : void Create primary key and indices.
processNull ( string $strTableName, array $arrColumns ) : void Define which columns of the given table can contain the "NULL" value.
runVacuumFullAndAnalyze ( string $strTableName ) : void Runs "vacuum full" and "ANALYZE" for given table.
setTableConstraints ( string $strTableName ) : boolean Set constraints (excluding foreign key constraints) for given table.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $arrConfig )
$arrConfig array

__destruct() 공개 메소드

Destructor.
public __destruct ( )

migrate() 공개 메소드

Performs migration from source database to destination database.
public migrate ( ) : void
리턴 void