ottowayne / sqlite-migration-fix by ottowayne

Laravel package to fix SQLite migrations by making all columns nullable in testing environments
2,853
3
1
Package Data
Maintainer Username: ottowayne
Maintainer Contact: mr.ottowayne@gmail.com (Ottowayne)
Package Create Date: 2015-04-12
Package Last Update: 2016-02-03
Language: PHP
License: MIT
Last Refreshed: 2024-04-18 15:19:56
Package Statistics
Total Downloads: 2,853
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 1
Total Forks: 1
Total Open Issues: 0

Laravel SQLite Migration Fix

This will fix the SQLite error Cannot add a NOT NULL column with default value NULL by making all columns nullable in testing environments.

Please note that this changes the behaviour of your app and thus may alter your test results.

Compatibility

  • Laravel 5.0

Installation

To install via composer add the following line to your composer.json:

"ottowayne/sqlite-migration-fix": "dev-master"

I recommend using this package in local environments (require-dev) only.

Finally add the service provider to your app.php:

'Ottowayne\SQLiteMigrationFix\DatabaseServiceProvider',

Usage

After adding the service provider you are done. The changes will only apply to the testing-environment.