From 916b769cdd75f7a302c780d12bcbe8f72386ca9b Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Tue, 24 Feb 2026 17:25:08 +0700 Subject: [PATCH] fix: add default values for SQLite compatibility SQLite cannot add NOT NULL columns without default values to existing tables. Add default(0) to votes and hotness columns. --- ...2019_07_09_000002_add_votes_and_hotness_to_discussions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/2019_07_09_000002_add_votes_and_hotness_to_discussions.php b/migrations/2019_07_09_000002_add_votes_and_hotness_to_discussions.php index 9fc907c7..8babda28 100755 --- a/migrations/2019_07_09_000002_add_votes_and_hotness_to_discussions.php +++ b/migrations/2019_07_09_000002_add_votes_and_hotness_to_discussions.php @@ -19,8 +19,8 @@ } $schema->table('discussions', function (Blueprint $table) { - $table->integer('votes'); - $table->float('hotness', 10, 4); + $table->integer('votes')->default(0); + $table->float('hotness', 10, 4)->default(0); }); }, 'down' => function (Builder $schema) {