1. Go to this page and download the library: Download ikkez/f3-schema-builder 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/ */
ikkez / f3-schema-builder example snippets
php
$db = new \DB\SQL('mysql:host=localhost;port=3306;dbname='.$DBname, $user, $pass);
php
$column = $table->addColumn('deleted');
$column->type($schema::DT_BOOL);
$column->nullable(false);
$column->defaults(0);
$column->after('id');
// or in a fluent way:
$table->addColumn('deleted')->type($schema::DT_BOOL)->nullable(false)->defaults(0)->after('id');
php
$table->addColumn('creation_date')->type($schema::DT_TIMESTAMP)->defaults($schema::DF_CURRENT_TIMESTAMP);
// a shorthand would be:
$table->addColumn('creation_date')->type_timestamp(TRUE);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.