diff options
author | Tortue Torche <tortuetorche@users.noreply.github.com> | 2019-12-11 12:24:47 +0300 |
---|---|---|
committer | Tortue Torche <tortuetorche@users.noreply.github.com> | 2019-12-11 12:24:47 +0300 |
commit | 8a68277246de8723b28d4795955df49634c3af2e (patch) | |
tree | bb5c313ba05554aff8caf959a077ccb865f52fd3 /lib/Migration | |
parent | 8124688958c04871ab30dafaeb0ae9760c77de90 (diff) |
SQLite can't have a NOT NULL constraint without DEFAULT value.
Here the SQLite error message:
An exception occurred while executing 'ALTER TABLE oc_polls_events ADD COLUMN show_results VARCHAR(255) NOT NULL':
SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
Signed-off-by: Tortue Torche <tortuetorche@users.noreply.github.com>
Diffstat (limited to 'lib/Migration')
-rw-r--r-- | lib/Migration/Version0010Date20190801063812.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Migration/Version0010Date20190801063812.php b/lib/Migration/Version0010Date20190801063812.php index f17e8ab8..f94a08ad 100644 --- a/lib/Migration/Version0010Date20190801063812.php +++ b/lib/Migration/Version0010Date20190801063812.php @@ -88,7 +88,8 @@ class Version0010Date20190801063812 extends SimpleMigrationStep { if (!$table->hasColumn('show_results')) { $table->addColumn('show_results', Type::STRING, [ 'notnull' => true, - 'lenght' => 64 + 'lenght' => 64, + 'default' => 'always' ]); } |