0.0.12 • Published 4 years ago

tmp-prisma-upgrade v0.0.12

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

⚠️ EXPERIMENTAL This tool is being built now. It's not ready for use. Please watch this repository for updates.

prisma-upgrade

Upgrade is a CLI tool to help Prisma 1 users upgrade to Prisma 2.

Usage

$ prisma-upgrade datamodel.prisma schema.prisma

Current features

This table reflects the current feature set of the upgrade CLI and will be updated continuously. Read below for a more detailled explanation of each column. You can also find more info about each of these feautures in the docs.

NameMySQLPostgreSQLPrisma schemaPrisma 1 compatible
Default valuesYesNot yetNot yetYes
@updatedAtNot yetn/aNot yetYes
Missing UNIQUE for inline 1-1YesNot yetNot yetYes
JSONYesNot yetNot yetYes
EnumsNot yetNot yetNot yetYes
Generated IDsn/aNot yetYesYes
@createdAtYesNot yetNot yetYes
Relation tables are all m-nNot yetNot yetNot yetNo
Scalar lists have extra tableNot yetNot yetNot yetNo
Cascading deletesNoNoNoNo
Maintain order of models and fieldsn/an/aNot yetNo
Maintain relation namesn/an/aNot yetNo

What do the columns mean?

  • MySQL: Does the CLI generate the correct MySQL statements to solve the problem?
  • PostgreSQL: Does the CLI generate correct PostgreSQL statements to solve the problem?
  • Prisma schema: Does the final Prisma schema I get from the CLI reflect the right solution?
  • Prisma 1 compatible: Does the SQL change to the schema maintain Prisma 1 compatibility?

Tests

Testing consists of 2 parts: a Local SQL Dump and Running Tests

Local SQL Dump

Requirements: MySQL@5, Docker

Since it's cumbersome to run Prisma 1 in CI, we need to locally setup test cases first

Setting up MySQL for examples

mysqladmin -h localhost -u root create prisma
mysql -h localhost -u root prisma < ./examples/mysql-ablog/dump.sql
mysqladmin -h localhost -u root drop prisma -f