首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >prisma在prisma部署后未应用更改

prisma在prisma部署后未应用更改
EN

Stack Overflow用户
提问于 2020-02-23 01:39:21
回答 3查看 946关注 0票数 2

我已经更新了数据模型中的一些类型,在运行$prisma deploy时,它显示已经进行了更改。但是,游乐场没有反映这一点,在再次运行$prisma deploy时,它会重新更新相同的更改。

例如,我一次又一次地收到这个消息,让我相信我的更新没有保存。

datamodel.prisma

代码语言:javascript
复制
type User {
  id: ID! @id
  name: String!
  email: String! @unique
  posts: [Post!]!
  comments: [Comment!]!

}

type Post {
  id: ID! @id
  title: String! 
  body: String!
  published: Boolean! 
  author: User!
  comments: [Comment!]!
}

type Comment {
    id: ID! @id
    text: String!
    author: User!
    post: Post!
  }

docker-compose.yml

代码语言:javascript
复制
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.34
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret

        databases:
          default:
            connector: postgres
            host: ec2-34-192-30-15.compute-1.amazonaws.com
            database: dcpap3nn15tguo
            schema: public
            user: qlhncorhibvkbb
            password: 273ef84b6ff75904084504c354f92879a036c887dfa4f688cdfaaf12f4e6c30d
            ssl: true
            rawAccess: true
            port: '5432'
            migrations: true

prisma.yml

代码语言:javascript
复制
endpoint: http://localhost:4466
datamodel: datamodel.prisma

以及每次我运行$prisma deploy时的终端消息

代码语言:javascript
复制
Deploying service `default` to stage `default` to server `local` 6.4s

Changes:

  User (Type)
  ~ Updated field `email`. It became unique.
  + Created field `posts` of type `[Post!]!`
  + Created field `comments` of type `[Comment!]!`

  Post (Type)
  + Created type `Post`
  + Created field `id` of type `ID!`
  + Created field `title` of type `String!`
  + Created field `body` of type `String!`
  + Created field `published` of type `Boolean!`
  + Created field `author` of type `User!`
  + Created field `comments` of type `[Comment!]!`

  Comment (Type)
  + Created type `Comment`
  + Created field `id` of type `ID!`
  + Created field `text` of type `String!`
  + Created field `author` of type `User!`
  + Created field `post` of type `Post!`

  PostToUser (Relation)
  + Created an inline relation between `Post` and `User` in the column `author` of table `Post`

  CommentToUser (Relation)
  + Created an inline relation between `Comment` and `User` in the column `author` of table `Comment`

  CommentToPost (Relation)
  + Created an inline relation between `Comment` and `Post` in the column `post` of table `Comment`

Applying changes 23.6s

Your Prisma endpoint is live:

  HTTP:  http://localhost:4466
  WS:    ws://localhost:4466

You can view & edit your data here:

  Prisma Admin: http://localhost:4466/_admin
EN

回答 3

Stack Overflow用户

发布于 2020-06-06 17:28:39

查看pgAdmin中的迁移表:

代码语言:javascript
复制
SELECT * FROM management."Migration"
ORDER BY "projectId" ASC, revision DESC

这可能是由于postgre抛出的一个错误,该错误没有显示在控制台的prisma deploy输出中。

对我来说,这是因为我将User.email设置为@unique,但已经有多个用户使用相同的电子邮件,奇怪的是,它没有被捕获,之后postgre不再接受任何迁移。

我在这里报告了这个错误:https://github.com/prisma/prisma/issues/2675

票数 1
EN

Stack Overflow用户

发布于 2021-04-22 20:57:56

同样的问题已经有一段时间了。不知道问题是什么,但我设法绕过了它

  1. prisma.yml中prisma的端点从http://localhost:4466更改为http://locolhost:4466/anylabel/default
  2. then run prisma1 deploy

这将在数据库上的新服务上部署您的应用程序。

然后,您可以在http://locolhost:4466/anylabel/default上查看新模型的更改

(希望它能帮上忙,不过我想你可能已经找到了解决方案)

票数 1
EN

Stack Overflow用户

发布于 2021-03-03 18:41:02

使用应该可以工作的prisma1 deploy

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60354928

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档