0

I have a problem with the install repository script. I have to use SQlite. In order to use SQlite with laravel the database must be created. The deploy script fails if there is no database there. But it is catch 22 because I don't want the database in version control as this causes errors with git. Is there a way to edit the deploy script or laravel to create the SQlite database on running the migration script?

I know I can do this manually with git and the artisan touch command but this defeats the point of the deploy script.

1 Answer 1

0

Following on from this post.

Migrations fail when SQLite database file does not exist?

I put this in the databes config file at the top.

$path = database_path('database.sqlite');
if (!file_exists($path) && is_dir(dirname($path))) {
    touch($path);
}

I still think there is probably a better solution out there though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.