Hi, I’m deploying a prisma app with Seed and I not...
# seed
r
Hi, I’m deploying a prisma app with Seed and I notice that if I make a db change like adding a column, if I deploy with Seed the prisma layer doesn’t get rebuilt. Is there a way to trigger seed to rebuild the prisma layer? Or potentially rebuild the whole stack?
This is causing errors when I try to write to the db column in production.
I notice if I deploy from my local machine I’m not getting the error.
t
On a completely different issue, I just added a new development stage in Seed and my app deployed fine. The existing dev stage would not deploy, throwing an error that seems like there is a package not getting properly updated. In Seed, if you create a new dev stage, will it deploy?
r
interesting.
Let me try that. I’ve tried redeploying the Layer by modifying the stack but that didn’t work. Let me try making a new stage and seeing what’s going on .
Wo that actually worked….. I’m confused. Does this mean seed is perserving build artifacts from build to build?
t
Seems like it. @Frank here it is with someone else.
r
Ok, so how I fixed this: 1. Remove prisma modules from node modules in seed cache 2. Force my PrismaLayer stack to redeploy on every push by adding a random number to the LayerVersion cdk construct
Copy code
seed.yml
before_compile:
    - cd /tmp/seed/source && rm -rf node_modules/@prisma && rm -rf node_modules/.prisma && rm -rf node_modules/prisma

before_build:
    - echo "Generating Prisma Types"
    - npx prisma generate
and
Copy code
stacks/LayerStack.ts

...
        const prismaLayer = new LayerVersion(stack, `PrismaLayer-${getRandomNumber()}`, {
            code: Code.fromAsset(path.resolve(layerPath)),
        });
...
Is there a better way to tell seed to only force deploy a particular stack?
if not this seems to work ok
f
if I make a db change like adding a column, if I deploy with Seed the prisma layer doesn’t get rebuilt
@Ryan Barnes hmm.. i’m not too familiar with Prisma. To clarify, when you add a column, does that update files in
node_modules/.prisma
?
r
Yeah, when I change the db schema, prisma makes a local schema file (that you check into source) and builds a client for you to use that gets stored in
node_modules/.prisma
This work around seems to work ok, however I’m running into issues when the stack fails and rolls back. I’m getting errors that it can’t find the Prisma layer. Is there any way to tell seed explicitly to always redeploy a stack?