Code Monkey home page Code Monkey logo

Comments (3)

Maxime-J avatar Maxime-J commented on June 5, 2024 1

A quick warning about this, because it isn't totally accurate.

There are two issues :

  • MySQL indeed supports UUID, but not as a data type, contrary to MariaDB.
    So moving from varchar to uuid is only possible with MariaDB.

  • Even though a Prisma string field apparently works with a MariaDB UUID column,
    Prisma doesn't offer @db.Uuid attribute with it.
    It doesn't look good having a difference between schema and actual database,
    and this could lead to some issues, SQL may be incorrectly generated by Prisma, which should be manually tweaked.

varchar isn't probably the ideal solution, but I don't think there's an easy alternative at the moment.

from umami.

franciscao633 avatar franciscao633 commented on June 5, 2024

Unfortunately we only support 1 schema file per database. It is possible to detect the db version before the build-db step and target a different schema file / migration folder, but it will add more maintenance and support on our side. Ideally we just cut-off support for older MySQL / MariaDB versions, update the schema off of VARCHAR(36) and move forward.

from umami.

juangacovas avatar juangacovas commented on June 5, 2024

Agree, just moving forward and require proper versions of MySQL/MariaDB that support the UUID data type seems OK to me too.

I don't have very high traffic sites right now and the degradation using VARCHAR(36) was noticeable to the point we observed timeouts (i.e. when deleting a site or just asking for data), so I gave a try and manually converting to UUID all of the column IDs and references really worked like a charm.

Anyway I understand this could require some testing for the initial structure and migrations. I can try help with MariaDB and MySQL, drop me a message and I can try to help / test.

from umami.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.