Shopify / shopify-app-template-php

286 stars 92 forks source link

Database (storage/db.sqlite) does not exist. #432

Open abimwaqas opened 1 year ago

abimwaqas commented 1 year ago

Issue summary

Write a short description of the issue here ↓ I'am creating a new app. At first installation I'm getting this error Database (storage/db.sqlite) does not exist. (SQL: PRAGMA foreign_keys = ON;)

Migrations ran perfectly and tinker is also working. I'm using Laravel. Note: All cache cleared and server restarted

Expected behavior

It should find database with default doc settings.

What do you think should happen?

Actual behavior

Throwing error db not found What actually happens?

Tip: include an error message (in a <details></details> tag) if your issue is related to an error

Steps to reproduce the problem

1. 1. 1.

Reduced test case

The best way to get your bug fixed is to provide a reduced test case.


Checklist

rajanipatel90 commented 1 year ago

@abimwaqas, I think you need to check the db.sqlite in the storage directory if you didn't find then it means it is not created.

You can create by touch storage/db.sqlite using the terminal in the /web directory.

Also, Please check the step of Setting up your Laravel app again.

abimwaqas commented 1 year ago

@rajanipatel90 As I said it's created and working with Tinker but when I open cloudflare url in browser it says db not found. But when I run on MySql everything works fine

rafaelstz commented 1 year ago

Hi @abimwaqas, once you create the database file, make sure to update your DB_DATABASE variable in .env with the full path to the file. Instead of using storage/db.sqlite, it should be something like /User/abimsmachine/shopify/storage/db.sqlite. To figure out the entire path you can go to the project folder and run pwd on your terminal.

rajanipatel90 commented 1 year ago

@abimwaqas Thanks for the clarification you are using the Cloudflare URL. In web/.env, the DB_DATABASE variable should have a full path of db.sqlite. Like below.

DB_DATABASE=/var/www/html/shopify-app-template-php/web/storage/db.sqlite

CHEWX commented 1 year ago

Hi @abimwaqas, once you create the database file, make sure to update your DB_DATABASE variable in .env with the full path to the file. Instead of using storage/db.sqlite, it should be something like /User/abimsmachine/shopify/storage/db.sqlite. To figure out the entire path you can go to the project folder and run pwd on your terminal.

This needs to be in the docs, this fixed my issue.