0

我现在花了几天时间试图弄清楚为什么我的后端无法在我的应用程序的在线版本上运行。我创建了一个 Nuxt 项目,该项目使用 Prisma 作为一个非常小而简单的数据库。

在积极使用 prisma 之前,我已经构建了应用程序的“Nuxt 部分”(尽管它已经在项目中实现了)。

过了一会儿,我为 prisma 创建了一个非常基本的 API 来使用,我让一切都在本地工作,然后我尝试通过添加以下行在 heroku 上构建它:release: npx prisma migrate deploy到我的 Procfile。

我认为这将使用最新的迁移来重新创建我的本地数据库,但是当浏览在线版本时,我注意到依赖于数据库的所有内容都不起作用,因为它可能不在数据库中。

我尝试手动进行迁移并推送分支以查看 Heroku 将记录的内容,结果如下:

2021-12-30T13:46:41.573842+00:00 heroku[release.1710]: State changed from starting to up
2021-12-30T13:46:43.062707+00:00 app[release.1710]: Prisma schema loaded from prisma/schema.prisma
2021-12-30T13:46:43.083393+00:00 app[release.1710]: Datasource "db": SQLite database "dev.db" at "file:./dev.db"
2021-12-30T13:46:43.118865+00:00 app[release.1710]: 
2021-12-30T13:46:43.118897+00:00 app[release.1710]: 12 migrations found in prisma/migrations
2021-12-30T13:46:43.118939+00:00 app[release.1710]: WARNING The following migrations have been modified since they were applied:
2021-12-30T13:46:43.118940+00:00 app[release.1710]: 20211216111431_init
2021-12-30T13:46:43.118941+00:00 app[release.1710]:
2021-12-30T13:46:43.120322+00:00 app[release.1710]:
2021-12-30T13:46:43.120440+00:00 app[release.1710]: No pending migrations to apply.
2021-12-30T13:46:43.348438+00:00 heroku[release.1710]: Process exited with status 0
2021-12-30T13:46:43.426838+00:00 heroku[release.1710]: State changed from up to complete
2021-12-30T13:46:45.281380+00:00 app[api]: Release v32 created by user marnixelling24@gmail.com
2021-12-30T13:46:46.373458+00:00 heroku[web.1]: Restarting
2021-12-30T13:46:46.454020+00:00 heroku[web.1]: State changed from up to starting
2021-12-30T13:46:47.466600+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-12-30T13:46:47.671788+00:00 heroku[web.1]: Process exited with status 143
2021-12-30T13:46:57.249166+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-30T13:46:58.317560+00:00 app[web.1]:
2021-12-30T13:46:58.317577+00:00 app[web.1]: > fullstack-nuxt@1.0.0 start /app
2021-12-30T13:46:58.317577+00:00 app[web.1]: > nuxt start
2021-12-30T13:46:58.317577+00:00 app[web.1]:
2021-12-30T13:46:59.566391+00:00 app[web.1]: ℹ Listening on: http://172.17.136.142:51422/
2021-12-30T13:46:59.601868+00:00 heroku[web.1]: State changed from starting to up

4

0 回答 0