Skip to content

thelinuxlich/prisma-mysql-comments-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published