SQLite数据库文件不存在时迁移失败? [英] Migrations fail when SQLite database file does not exist?

查看:72
本文介绍了SQLite数据库文件不存在时迁移失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当数据库文件不存在时,迁移(某种程度上)似乎会以静默方式失败.迁移已执行,但未创建任何db文件,我可以再次运行迁移. (它永远不会说什么也不需要迁移").如果我创建一个空白文件,那么它将起作用.

It seems that migrations (sort of) fail silently when the database file does not exist. The migration executes but no db file is created and I can run the migration again. (It never says "nothing to migrate") If I create a blank file then it works.

这很奇怪,因为我认为SQLite总是会在未找到数据库文件的情况下创建该数据库文件,因此我不确定这是错误还是我做错了什么.也许是权限问题?但是其他所有工作都正常,所以我不知道.我正在使用Windows 7,并且该项目在我的

This is odd because I thought SQLite always created the db file if it was not found so I'm not sure if this is a bug or something I've done wrong. Maybe it's a permissions problem? But everything else is working so I don't know. I'm using Windows 7 and the project is in my

推荐答案

我针对 laravel/框架.

希望如果数据库不存在或自动创建一个版本,将来的版本将给出错误消息.

Hopefully future versions will give an error if the database doesn't exist, or automatically create one.

这篇关于SQLite数据库文件不存在时迁移失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆