我已经更新了数据模型中的一些类型,在运行$prisma deploy时,它显示已经进行了更改。但是,游乐场没有反映这一点,在再次运行$prisma deploy时,它会重新更新相同的更改。
例如,我一次又一次地收到这个消息,让我相信我的更新没有保存。
datamodel.prisma
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
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: trueprisma.yml
endpoint: http://localhost:4466
datamodel: datamodel.prisma以及每次我运行$prisma deploy时的终端消息
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发布于 2020-06-06 17:28:39
查看pgAdmin中的迁移表:
SELECT * FROM management."Migration"
ORDER BY "projectId" ASC, revision DESC这可能是由于postgre抛出的一个错误,该错误没有显示在控制台的prisma deploy输出中。
对我来说,这是因为我将User.email设置为@unique,但已经有多个用户使用相同的电子邮件,奇怪的是,它没有被捕获,之后postgre不再接受任何迁移。
我在这里报告了这个错误:https://github.com/prisma/prisma/issues/2675
发布于 2021-04-22 20:57:56
同样的问题已经有一段时间了。不知道问题是什么,但我设法绕过了它
prisma.yml中prisma的端点从http://localhost:4466更改为http://locolhost:4466/anylabel/defaultprisma1 deploy这将在数据库上的新服务上部署您的应用程序。
然后,您可以在http://locolhost:4466/anylabel/default上查看新模型的更改
(希望它能帮上忙,不过我想你可能已经找到了解决方案)
发布于 2021-03-03 18:41:02
使用应该可以工作的prisma1 deploy
https://stackoverflow.com/questions/60354928
复制相似问题