Hello Play developers,
I recently started using Play and wrote a SQL script for Evolutions with the "!Ups" and "!Downs" parts commented out, but I was surprised to see they were not recognized by Play. I did some research and I realized that they expected comments beginning with "#" instead of "--". In the DBs I'm used to, their dialect of SQL only uses standard SQL comment syntax, which is prefixed with "--" and not "#" (like MySQL, according to a Google search). Furthermore, when writing SQL in a non-MySQL dialect (PostgreSQL, Oracle, SQL, etc.), many editors will show the lines beginning with "#" as syntax errors, which could also have an affect on linting and automated code review.
I would like to propose an alternative syntax for Play Evolutions to rectify this. In particular, these would need to be the changes going forward:
- Generated evolutions files should use "--" instead of "#" to delimit comments, to be more standards-compliant
- More liberal regex definitions to accept "#", "--", and possibly even single-line "/* */"-style comment syntax
This way, going forward Play Evolutions will default to a more "standard" single-line comment style and be slightly more liberal in the comment styles it accepts for hand-written evolutions.
Anyway, I would be happy to write a PR myself and submit it for review. I thought I'd ask first and see what people think of the idea before I go ahead. Would a change like this work for Play as it is?
Sincerely,
Ryan Peters, hopeful contributor