danilocgsilva / class_to_sql_schema_script
1.9.0
2024-09-05 17:47 UTC
Requires (Dev)
- phpunit/phpunit: ^11.1
README
Instalation
composer require danilocgsilva/class_to_sql_schema_script
Usage
-
Create a classe with the database properies.
-
Get the sql script.
Example:
use Danilocgsilva\ClassToSqlSchemaScript\DatabaseScriptSpitter;
.
.
.
$databaseScriptSpitter = new DatabaseScriptSpitter("your_database_name");
return $databaseScriptSpitter->getString();
It will result in:
CREATE DATABASE your_database_name DEFAULT CHARACTER SET utf8 COLLATE utf8mb3_unicode_ci;
Check more usage examples in tests.