Laravel Database migrations Schema builder custom column type -
i trying create migrations laravel in situation need custom column type since 1 want isn't included in schema builder , "polygon". want know, how can create custom column type, other in schema builder.
what want in sql statement:
alter table
xxx
addpolygon
polygon not null
is possible myself or forced use library this?
i know can this:
db::statement('alter table country add column polygon polygon');
but leads me error table doesn't exist.
i assume require spatial fields in db... consider via packagist.org , search laravel-geo (or equivalent) - supports spatial column tyes inc polygon. use standard laravel migration files custom fields -e.g.
$table->polygon('column_name');
in function in migration file...
Comments
Post a Comment