umbrellio/laravel-pg-extensions

Add using statement

Closed this issue · 0 comments

I trying to change column type and convert columns values.
I can't put USING statement in blueprint methods.

Sample SQL request:

#title is varchar
ALTER TABLE posts ALTER COLUMN title TYPE json USING  ('{"en":"' || title || '"}')::json

i can now only put it in DB::statement . : (

i want get something like following:

Schema::table('posts', function (Blueprint $table) {
    $table->json('title')->using($expression)->change();
 });