PHP code example of fyre / forge

1. Go to this page and download the library: Download fyre/forge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fyre / forge example snippets


use Fyre\Forge\ForgeRegistry;

$forge = ForgeRegistry::getForge($connection);

ForgeRegistry::setHandler($connectionClass, $forgeClass);

$forge->addColumn($table, $column, $options);

$forge->addIndex($table, $index, $options);

$tableForge = $forge->build($table);

$forge->createTable($table, $columns, $options);

$forge->dropColumn($table, $column, $options);

$forge->dropIndex($table, $index);

$forge->dropTable($table, $options);

$connection = $forge->getConnection();

$forge->renameColumn($table, $column, $newColumn);

$forge->renameTable($table, $newTable);

$forge->addColumn($table, $column, $options);

$forge->addForeignKey($table, $foreignKey, $options);

$forge->addIndex($table, $index, $options);

$forge->alterTable($table, $options);

$tableForge = $forge->build($table, $options);

$forge->changeColumn($table, $column, $options);

$forge->createSchema($schema, $options);

$forge->createTable($table, $columns, $options);

$forge->dropForeignKey($table, $foreignKey);

$forge->dropPrimaryKey();

$forge->dropSchema($schema, $options);

$forge->addColumn($table, $column, $options);

$forge->addForeignKey($table, $foreignKey, $options);

$forge->alterColumnAutoIncrement($table, $column, $autoIncrement);

$forge->alterColumnDefault($table, $column, $default);

$forge->alterColumnNullable($table, $column, $nullable);

$forge->alterColumnType($table, $column, $options);

$tableForge = $forge->build($table, $options);

$forge->commentOnTable($table, $column, $comment);

$forge->commentOnTable($table, $comment);

$forge->createSchema($schema, $options);

$forge->createTable($table, $columns, $options);

$forge->dropConstraint($table, $index);

$forge->dropForeignKey($table, $foreignKey);

$forge->dropPrimaryKey();

$forge->dropSchema($schema, $options);

$tableForge->addColumn($column, $options);

$tableForge->addForeignKey($foreignKey, $options);

$tableForge->addIndex($index, $options);

$tableForge->changeColumn($column, $options);

$tableForge->clear();

$column = $tableForge->column($name);

$columnNames = $tableForge->columnNames();

$columns = $tableForge->columns();

$tableForge->drop();

$tableForge->dropColumn($column);

$tableForge->dropForeignKey($foreignKey);

$tableForge->dropIndex($index);

$tableForge->execute();

$foreignKey = $tableForge->foreignKey($name);

$foreignKeys = $tableForge->foreignKeys();

$forge = $tableForge->getForge();

$tableName = $tableForge->getTableName();

$hasColumn = $tableForge->hasColumn($name);

$hasForeignKey = $tableForge->hasForeignKey($name);

$hasIndex = $tableForge->hasIndex($name);

$index = $tableForge->index($name);

$indexes = $tableForge->indexes();

$tableForge->rename($table);

$tableForge->setPrimaryKey($columns);

$queries = $tableForge->sql();