Skip to content

Files

Latest commit

 

History

History
40 lines (25 loc) · 1.02 KB

README.md

File metadata and controls

40 lines (25 loc) · 1.02 KB

prisma-mysql-comments-generator

Generate database comments from Prisma schema to a MySQL database.

It is based on the following code idea. Thank you @Jyrno42 .

Features

  • Create a migration SQL for the ALTER TABLE table_name MODIFY COLUMN column_name column_type COMMENT "comment"; statement based on the information in the schema.prisma file.
    • Comments written with triple slashes (///) are eligible.
  • Supports only column comments for now (PRs are welcome).

Usage

Install this package.

npm install --save-dev prisma-mysql-comments-generator

Add the generator to the schema.prisma

generator comments {
  provider = "prisma-mysql-comments-generator"
}

Run npx prisma generate to trigger the generator. A SQL file with ALTER TABLE table_name MODIFY COLUMN column_name column_type COMMENT "comment"; is generated in the migrations folder.

License

MIT

Author

thelinuxlich