php - Add Not Nullable column to laravel migration with existing DB data -


i have add new column existing table has data in , running bit of hiccup.

  1. how can add column? going not nullable field. i'm ok populating default data right , going , updating later. if need drop constraints while adding. i'm assuming i'm going need utilize straight sql queries.

  2. make work w/ phpunit , sqlite, i'm getting error sqlstate[hy000]: general error: 1 cannot add not null column default value null (sql: alter table "tracks" add column "short_description" text not null)

how modify migration?

public function up() {     schema::table('tracks', function(blueprint $table)     {         $table->text('short_description')->after('description');     }); } 

you have set default value:

public function up() {     schema::table('tracks', function(blueprint $table)     {         $table->text('short_description')->after('description')->default('default_value');     }); } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -