Database
Schema Preview
This page shows how a typed PHP schema blueprint is translated into SQL by the active database grammar. No statement is executed against the database.
Mode
alter
Table
_tmp_schema_demo_article
Status
Preview readyPreview only. No SQL was executed.
PHP blueprint
Input$schema->table('_tmp_schema_demo_article', static function (TableBlueprint $table): void {
$table->string('meta_title', 255)
->nullable()
->after('title')
->comment('Optional SEO meta title.');
$table->string('meta_description', 500)
->nullable()
->after('meta_title')
->comment('Optional SEO meta description.');
$table->index('meta_title');
});
Generated SQL
OutputALTER TABLE `_tmp_schema_demo_article` ADD `meta_title` VARCHAR(255) NULL COMMENT 'Optional SEO meta title.' AFTER `title`
ALTER TABLE `_tmp_schema_demo_article` ADD `meta_description` VARCHAR(500) NULL COMMENT 'Optional SEO meta description.' AFTER `meta_title`
ALTER TABLE `_tmp_schema_demo_article` ADD KEY `index_meta_title` (`meta_title`)