`deploy` hangs when I make a field that was previo...
# prisma-whats-new
j
deploy
hangs when I make a field that was previously optional now required and where there's already data which was entered prior to the field being required... Is there a way to run migrations on the database or something to fix this? I.e.
Copy code
myThingInDatabase = {blah: "Asd"}
type Thing {
  blah: String
  foo: String
}

===>

myThingInDatabase = {blah: "Asd"}
type Thing {
  blah: String
  foo: String!
}
`
^ Hangs on deploy
t
Just to clarify: so you're adding
foo: String!
to the Thing type and the deploy is failing?
l
Do you have a comma in your type? If so, that's not proper SDL so it's probably failing on that.
j
That's not a literal code sample, sorry.
Wait... I don't think I've typed that well
Updated.
So I'm adding just
!
to foo.
l
You'll need a migration value because
foo
cannot be null
t
Add something like
@defaultValue(value: "bar")
So change it to
foo: String! @defaultValue(value: "bar")
Then after you've deployed, you can go back and remove
@defaultValue(value: "bar")
j
Perfect, thanks 👍
I didn't think of doing that 😄
t
I ran into the same issue yesterday haha
n
@jof can you please create a bug report for your specific changes here: https://github.com/graphcool/prisma/issues? thanks!
@Taylor, in Prisma it's now called
@default
, not
@defaultValue