https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-migrate
  • m

    mikkelsl

    08/20/2020, 11:07 AM
    Is it possible to use prisma migrate based on .env in root instead of prisma/.env? I can make it work with prisma client using dotenv-cli
    j
    • 2
    • 3
  • e

    ed

    08/20/2020, 5:58 PM
    Got a question about how the
    README.md
    is generated in a migration. I’ve had a case where the SQL in the
    README.md
    included some
    ALTER TABLE _table_ …
    but were not in the
    steps.json
    file. So when I ran the
    migrate up
    , the table was not altered as advertised in the
    README.md
    . Is this a bug or is there something with our setup that could have caused this?
    j
    • 2
    • 1
  • j

    jknr

    08/21/2020, 9:10 AM
    There seems to be different philosophies around data migrations. django does data migrations as part of migration via RunPython operations. Rails docs show how to interact with Models in a migration. A thoughtbot post suggests using rake scripts which aligns with our approach, where we use complementary scripts that we just go in and run on staging and production servers. I guess my question is what your take is on data migration or if youve limited it to only seeding ?
    j
    a
    • 3
    • 8
  • s

    Spencer Curry

    08/21/2020, 3:28 PM
    hey yall, i have a somewhat noob question so hopefully there is a simple answer: I have an existing postgresql database and I want to set up a graphql API server to perform basic CRUD on it and feed data to a few client applications we have. My question is, "what steps should i take to set up my prisma server with my existing database?" I originally thought this was a simple SQL migration setup, but as I read the docs, it became unclear if it would work as intended. Can anyone advise me on the steps to take to turn my existing database into a Prisma CRUD API?
    j
    j
    • 3
    • 21
  • j

    Jonathan

    08/26/2020, 1:27 PM
    Hey folks, I will forward a CI/CD question from the prisma2 channel, I am currently struggling with. For those who have a "battle-tested" CI/CD pipeline, where in the process do you like to perform migrations? After the API is deployed? Before? Or parallel?
    j
    • 2
    • 1
  • t

    Tim Leslie

    08/28/2020, 1:22 AM
    I’m seeing something a bit odd (
    2.6.0-dev.44
    ) when running migrations. I can run my initial migration and see the
    _Migration
    table get correctly populated with the appropriate info. I then change my schema, generate and run a second migration. The migration run successfully, the database is updated as expected, all the commandline output is 🚀 , but now my
    _Migration
    table is empy. I would expect to see two entries, but I’m seeing zero. Has anyone else seen this happen? Should I submit a bug report?
    j
    • 2
    • 3
  • t

    Tim Leslie

    08/31/2020, 12:58 AM
    I’m now seeing the following issue on
    2.6.0-dev47
    , where specifying a particular
    schema
    name in my postgres database causes the initial migration not to run at all:
    j
    • 2
    • 5
  • w

    Wade Tandy

    09/11/2020, 5:01 PM
    Hi. Is there a way to execute raw SQL as part of the prisma migration workflow? Some things can't be represented by the schema/migrations system and I'd still like to roll them out the same way if possible.
  • j

    Josef Henryson

    09/16/2020, 12:04 PM
    Hi, I am about to start looking att migrating from Prisma 1 to Prisma 2 and found this upgrade page that refers to ‘schema incompabilities’ (see image). That link just goes to https://www.nexusjs.org/#/. Does anyone know the URL to the correct page for this information (if it still exist?).
    j
    n
    • 3
    • 3
  • p

    Pascal

    09/22/2020, 8:59 AM
    Dear all, I'm currently upgrading a website from Graphcool to Prisma 2, according to the upgrade guide (https://www.prisma.io/docs/guides/upgrade-guides/upgrade-from-graphcool). However, within the database are linked files (File table) pointing to https://files.graph.cool... Those files are not available anymore. I was wondering if there is a way to retrieve those files. thanks a lot Pascal
    a
    j
    • 3
    • 3
  • a

    Alberto Perdomo

    09/22/2020, 11:25 AM
    has renamed the channel from "migrations" to "prisma-migrate"
  • m

    mikkelsl

    09/25/2020, 4:59 PM
    How do you handle migrations across branches at this time? I don't have a good strategy for avoiding merging the migrations folder from develop to main f.i.
  • m

    Mikastark

    09/29/2020, 2:53 PM
    Hello everyone 🙂 There is any news about Prisma migrate ? I haven't seen any update about it in months. I am not confortable with SQL (I haven't used it since college 😋) so I really look forward this wonderful tool.
    💯 2
    👍 1
    m
    a
    j
    • 4
    • 10
  • e

    ed

    10/06/2020, 5:53 PM
    Hey @Alberto Perdomo — will work on imperative or data migrations be included in this next rev? Similar to some of the detail provided in https://github.com/prisma/migrate/issues/492 ? Would this fall under the “orchestrate complex migrations” stream?
    👍 3
    a
    • 2
    • 2
  • j

    jknr

    10/13/2020, 11:02 AM
    hey, we're using prisma.executeRaw for db migrations, but it seems that long running db queries can time out?! does prisma have a timeout for queries? and can we increase it somehow? cheers
    a
    • 2
    • 4
  • j

    Josef Henryson

    10/20/2020, 6:59 AM
    Hi, I am trying to run the Prisma Upgrade CLI to upgrade my MySQL DB to Prisma 2, it gives me this: ALTER TABLE
    File
    ADD UNIQUE (
    logoCompany
    );
    but there is no field/column called logoCompany on File, so I get this error: Key column ‘logoCompany’ doesn’t exist in table Any ideas on how I can proceed from this state? Do I have to manually add the field and populate it with values? Or can I put the unique constraint on the Company field ‘logotype’ instead? Thanks 🙏🏼
    n
    • 2
    • 11
  • u

    uzu

    10/21/2020, 9:15 AM
    Is anyone using migration on production level?
    🖐️ 2
  • p

    Pierre Ortega

    10/21/2020, 6:21 PM
    I am
  • b

    Brian Bancroft

    10/22/2020, 4:04 PM
    Hi there, I've been using prisma migrate on a side project for a couple months now. It's just a basic todo list app on psql, but it's been giving me nothing but excellence for the past while. Thanks for making such an excellent tool!
    ❤️ 3
    prisma rainbow 1
  • a

    Alberto Perdomo

    10/30/2020, 5:41 PM
    <!channel> Hello everyone! 👋 We are making changes to Prisma Migrate and are making it available in Early Access so we can receive your feedback. Please find all the details including how to access it and the corresponding documentation in #product-feedback. Also happy to take questions and receive feedback here. https://prisma.slack.com/archives/C01739JGFCM/p1604078848016200
    🎉 7
    ✅ 2
    🙌 3
    👏 1
  • j

    Jonathan

    10/30/2020, 5:52 PM
    Hi Alberto, awesome and great to read this! Just a check, with these changes, I seem to understand that all of this is still development and not recommended for production. If so, how would you use this tool in production context EDIT: Documentation is crystal clear now about this
    👍 1
  • m

    Maciek K

    11/10/2020, 4:52 PM
    At current state which Migrate is 'more stable' for use (I'm aware that both are not full stable yet) ?The new 'early access' one or the earlier '--experimental'?. Anyone had any issues, database breakage using migrate? I was holding off prisma1>prisma2 upgrade, cause of lack of migrations. I'm eager to do the upgrade to prisma2 now, but am a little scared. I'm not comfortable with raw sql migrations. Any info will be great, thank you.
    a
    j
    • 3
    • 4
  • m

    Marvin

    11/20/2020, 8:59 PM
    Is it planned for the future that
    prisma migrate
    (new migrate) can handle renaming of models & fields?
    t
    d
    f
    • 4
    • 9
  • d

    Dmitry Petrov

    11/26/2020, 12:24 AM
    Hi all! I have a question seemingly related to the 2.12.0 release. With the following change “1-1-relations must now have an optional side”, I was getting an error when running
    npx prisma migrate save --experimental
    relating to the virtual side of a relation being required. After updating the
    schema.prisma
    file accordingly, it still gives me the same errors. Are there any additional steps I need to take? Has anyone else experienced this?
    m
    j
    • 3
    • 11
  • d

    Dmitry Petrov

    11/26/2020, 12:47 AM
    It seems that deleting /prisma/migrations and truncating the _Migration table in the database did the trick
    👀 1
  • j

    jknr

    12/07/2020, 6:12 PM
    hey hey, i suppose migrate.lock is just local info? ie. shouldn't be pushed to remote?
  • m

    Marvin

    12/09/2020, 6:36 PM
    Is there a way to run
    prisma migrate
    programmatically by importing and calling a function from some of the
    @prisma
    packages? I currently use
    execa
    and run the command but I'm just curious if there is a better way to do that. 🙂
    t
    • 2
    • 2
  • d

    Daniel Norman

    12/15/2020, 5:22 PM
    Hey folks, I just published a walk through video through on upgrading Prisma Migrate from the Experimental version to the Preview version.

    https://www.youtube.com/watch?v=0LKhksstrfg&amp;feature=youtu.be&amp;ab_channel=Prisma▾

    🦜 4
    prisma rainbow 4
    💯 5
    💚 3
    👍 5
  • d

    Daniell

    12/17/2020, 3:25 PM
    Can I work around this somehow? Running this command:
    DATABASE_URL=$(heroku config:get DATABASE_URL -a foodsy-db) prisma migrate dev --create-only --preview-feature
    Copy code
    Error: A migration failed when applied to the shadow database:
    
    
    Database error: Error querying the database: db error: ERROR: permission denied to create database
    Can I create the db manually? Or am I supossed to run deploy for this use case? 🤔
    m
    t
    a
    • 4
    • 6
  • z

    Zarazas

    12/17/2020, 4:43 PM
    I would like to use the new
    prisma migrate reset --preview-feature
    as part of my testing suite to reset my db, however running it with
    exec
    results in:
    Copy code
    Error: Command failed: prisma migrate reset --preview-feature
    Error: We detected that your environment is non-interactive. Running this command in not supported in this context.
    Is there a way to circumvent this or run the reset programmatically?
    a
    • 2
    • 9
12345...9Latest