snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.9k stars 3.15k forks source link

artisan migrate:reset QueryException #2116

Closed vjandrea closed 8 years ago

vjandrea commented 8 years ago

Expected Behavior (or desired behavior if a feature request)

$ artisan migrate:reset should rewind all migrations and start over with a clean db


Actual Behavior

I see an error message. I'm using SQLite

$ artisan migrate:reset

[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1 no such column: created_at (SQL: CREATE TEMPORARY TABLE __temp__custom_fieldsets AS SELECT id, name, created_at, updated_at FROM custom_fieldsets)

[PDOException]
SQLSTATE[HY000]: General error: 1 no such column: created_at

Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

$ git pull snipe v3-master
$ rm database/database.sqlite
$ touch database/database.sqlite
$ artisan migrate --seed
$ artisan snipeit:create-admin --first_name=John --last_name=Doe --email=john@doe.dev --username=johndoe --password=...
$ artisan serve
snipe commented 8 years ago

We don't officially support sqlite

dmeltzer commented 8 years ago

I'm going to suggest useing snipeit:pave and then artisan migrate if you want to get back to a fresh db. I've spent a few hours working through the migrations and I've only made it through 9 months of them. Sqlite doesn't support dropping multiple columns at once, so the logic gets much messier and there are a lot of other migrate:reset issues buried in the history as well.

vjandrea commented 8 years ago

@dmeltzer I'm not a fan of workarounds like paveit but in this case i agree, migrations are quite messy and probably need a complete refactoring from the ground up. Maybe for v4?