Skip to content

Commit

Permalink
verify SQLite db version requirement in UpdateManager::update()
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Apr 16, 2024
1 parent d46c368 commit f943343
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"require": {
"php": "^8.2",
"winter/storm": "dev-wip-laravel-11",
"winter/storm": "dev-wip-laravel-11 as 1.2",
"winter/wn-system-module": "dev-wip-laravel-11",
"winter/wn-backend-module": "dev-wip-laravel-11",
"winter/wn-cms-module": "dev-wip-laravel-11",
Expand Down
7 changes: 7 additions & 0 deletions modules/system/classes/UpdateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ public function bindContainerObjects()
public function update()
{
try {
$connection = Schema::getConnection();
if ($connection->getDriverName() === 'sqlite') {
if (version_compare($connection->getServerVersion(), '3.35', '<')) {
throw new Exception("SQLite version minimum requirement not met (>= 3.35)");
}
};

$firstUp = !Schema::hasTable($this->getMigrationTableName());
if ($firstUp) {
$this->repository->createRepository();
Expand Down
9 changes: 0 additions & 9 deletions modules/system/console/WinterInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,6 @@ protected function setupMigrateDatabase()
{
$this->line('Migrating application and plugins...');

$connection = Schema::getConnection();

if ($connection->getDriverName() === 'sqlite') {
if (version_compare($connection->getServerVersion(), '3.35', '<')) {
$this->error("SQLite version minimum requirement not met (>= 3.35)");
exit;
}
};

try {
Db::purge();

Expand Down

0 comments on commit f943343

Please sign in to comment.