Henry
08/29/2018, 7:59 PMtype Document {
id: ID! @unique
title: String!
cloudUrl: String! # <http://my-app.amazon.aws.com/ITEM_ID|my-app.amazon.aws.com/ITEM_ID> for example
localUrl: String! # I'm adding this. I want to migrate it to <http://files.my-app.com/ITEM_ID|files.my-app.com/ITEM_ID>
}
I guess I’m just looking for a way to run a custom migration script as part of the deployment process.weakky
08/29/2018, 10:34 PMPrismaBinding
linked to your GraphQL API, and then use all the power of javascript to do whatever you want. eg: const documents = await binding.query.documents({ where: { cloudUrl_not: null })
, then `await Promise.all(documents.map(document => binding.mutation.updateDocument({ where: { id: document.id }}, data: { localUrl: <http://files.my-app.com/${document.id}|files.my-app.com/${document.id}>
} })))`