From 6858fd0e5a9b1e847c2e3adf2fbf229b480144ff Mon Sep 17 00:00:00 2001 From: bradmkjr Date: Sat, 26 Nov 2016 13:11:47 -0700 Subject: [PATCH] Resolves issue with SQLite databases, and defaults Adding nullable() allows column to be added to SQLite tables. SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL (SQL: alter table "users" add column "settings" text not null) SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL --- migrations/2015_01_20_105810_add_settings_to_users_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/2015_01_20_105810_add_settings_to_users_table.php b/migrations/2015_01_20_105810_add_settings_to_users_table.php index f2026c8..613136b 100644 --- a/migrations/2015_01_20_105810_add_settings_to_users_table.php +++ b/migrations/2015_01_20_105810_add_settings_to_users_table.php @@ -14,7 +14,7 @@ public function up() { Schema::table('users', function(Blueprint $table) { - $table->text('settings'); + $table->text('settings')->nullable(); }); }