PHPackages                             psylogic/laravel-sqlite-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. psylogic/laravel-sqlite-handler

ActiveLibrary[Database &amp; ORM](/categories/database)

psylogic/laravel-sqlite-handler
===============================

Handle Migrations limitation while testing

251PHPCI failing

Since May 19Pushed 6y ago2 watchersCompare

[ Source](https://github.com/PsyLogic/handle-laravel-sqlite-limitation)[ Packagist](https://packagist.org/packages/psylogic/laravel-sqlite-handler)[ RSS](/packages/psylogic-laravel-sqlite-handler/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

**Handle Laravel SQLite limitation**

works with Laravel 5.6, 5.7, 5.8, 6.x, 7.x

```
composer require psylogic/laravel-sqlite-handler
```

> Based on PR [laravel/framework#32737](https://github.com/laravel/framework/pull/32737)

Sometimes we are dealing with an existing projects and we decide to add Unit Testing, the issue is when we have a hundreds of migrations some of them are dropping columns and adding new columns to an existing tables also dropping foreign keys it become hard to maintain since we always prefer to use SQLite on memory or local file The solution that provided is adding more test inside the migrations files like:

```
if (\DB::getDriverName() != 'sqlite') {
  $table->string('column');
}else{
  $table->string('column')->nullable();
}
```

```
if (\DB::getDriverName() != 'sqlite') {
   $table->dropColumn('column1');
   $table->dropColumn('column2');
}else{
   $table->dropColumn(['column1', 'column2']);
}
```

> Or without conditions you can update your code to `$table->dropColumn(['column1', 'column2']);` it is acceptable by default in Laravel for all drivers

```
if (\DB::getDriverName() != 'sqlite') {
  $table->dropForeign('name');
}
```

Or Create **separate migrations** or modify all the affected migrations by refactoring code to suit SQLite limitations.

***Now you shouldn't be worry about adding condition in the migrations files or create separete migrations***

What Covered:

- dropping columns in one single migration file (Fix: SQLite doesn't support multiple calls to dropColumn)
- Add Nullable for new columns on existing table (Fix: Cannot add a NOT NULL column with default value NULL)
- dropping foreign keys (Fix: SQLite doesn't support dropping foreign keys)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8070135?v=4)[Othmane Nemli](/maintainers/PsyLogic)[@PsyLogic](https://github.com/PsyLogic)

---

Top Contributors

[![PsyLogic](https://avatars.githubusercontent.com/u/8070135?v=4)](https://github.com/PsyLogic "PsyLogic (14 commits)")[![samtarmizi](https://avatars.githubusercontent.com/u/48077864?v=4)](https://github.com/samtarmizi "samtarmizi (1 commits)")

---

Tags

databaselaravelsqlite

### Embed Badge

![Health badge](/badges/psylogic-laravel-sqlite-handler/health.svg)

```
[![Health](https://phpackages.com/badges/psylogic-laravel-sqlite-handler/health.svg)](https://phpackages.com/packages/psylogic-laravel-sqlite-handler)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
