Graphql 普里斯马不是';t在prisma部署后应用更改
我已经更新了数据模型中的一些类型,在运行Graphql 普里斯马不是';t在prisma部署后应用更改,graphql,prisma,Graphql,Prisma,我已经更新了数据模型中的一些类型,在运行$prisma deploy时,它显示已经进行了更改。但是,游乐场不会反映这一点,在再次运行$prisma deploy时,它会重新更新相同的更改 ie我一次又一次地收到这条消息,使我相信我的更新没有保存 datamodel.prisma type User { id: ID! @id name: String! email: String! @unique posts: [Post!]! comments: [Comment!]!
$prisma deploy
时,它显示已经进行了更改。但是,游乐场不会反映这一点,在再次运行$prisma deploy
时,它会重新更新相同的更改
ie我一次又一次地收到这条消息,使我相信我的更新没有保存
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: true
普里斯玛
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
查看pgAdmin中的迁移表:
SELECT * FROM management."Migration"
ORDER BY "projectId" ASC, revision DESC
这可能是由于postgre引发的错误,该错误未显示在控制台的prisma deploy
输出中
对我来说,这是因为我将User.email
设置为@unique
,但已经有多个用户使用同一封电子邮件,奇怪的是,它没有被捕获,此后postgre将不再接受任何迁移
我在这里报告了这个错误:使用
prisma1部署
,它应该可以工作已经有一段时间了。我不知道问题出在哪里,但我还是设法避开了
http://localhost:4466
至http://locolhost:4466/anylabel/default
prisma1部署
http://locolhost:4466/anylabel/default
(希望能有所帮助,不过我想你可能已经找到了解决办法)