The integration adds two Artisan commands for managing your Surqlize schema. Both read the model list from config('surqlize.models').
Dumping the schema
surqlize:schema-dump prints the schema definitions for the configured models without executing them.
php artisan surqlize:schema-dumpPass --connection to indicate which connection the dump is intended for.
php artisan surqlize:schema-dump --connection=analyticsApplying the schema
surqlize:schema-apply runs the schema definitions against the database.
php artisan surqlize:schema-apply| Option | Description |
|---|---|
--dry-run | Print the schema DDL instead of executing it |
--dump | Alias of --dry-run |
--connection= | The SurrealDB connection to apply to |
php artisan surqlize:schema-apply --dry-run
php artisan surqlize:schema-apply --connection=analytics Register every model that should take part in schema commands in config('surqlize.models'). The commands fail if a configured class does not extend Surqlize\Model\Model.
Learn more
Schema for defining tables and fields
Configuration for the model list
Surqlize CLI for the framework-agnostic commands