learnshopify.dev/Workspace
local task

Move your app from the SQLite file to a Postgres database for development.

Pass criterion: Your schema uses Postgres through `DATABASE_URL`, your migrations are new ones made for Postgres, and `.env` is not in git.
$ npx @learnshopifydev/cli check move-your-database-to-postgres
1. Sign up at Railway and create a project with a database

Railway is the host this path uses. In a new project, click `+ New` and add PostgreSQL.

2. Make the database reachable from your computer

In the Postgres service, open Settings, then Networking, and add Public Access. `DATABASE_PUBLIC_URL` appears on its Variables tab.

3. Create the file `.env` in your app folder with this line

Paste the value of `DATABASE_PUBLIC_URL` between the quotes. Git ignores `.env`, so the password stays on your computer.

4. Give your agent the job

Paste this message to your agent.

5. Start your app again and open it

Stop `shopify app dev` first if it is running. The new database is empty, so your Bundles page says Create your first bundle, although your bundles are still on your store.

6. Look at what changed, then commit

You should see `prisma/schema.prisma` and the migrations folder, and not `.env`. Then commit: `git add -A`, then `git commit -m "Postgres"`.

0 / 1 task solved