Skip to content

Commit

Permalink
Use SQL92 comment syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed Aug 14, 2023
1 parent fc1a3f0 commit 7e600cf
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public void create() {
content =
new String(Files.readAllBytes(evolutions.toPath()), StandardCharsets.UTF_8);
}
if (content.isEmpty() || content.startsWith("# --- Created by Ebean DDL")) {
if (content.isEmpty()
|| content.startsWith("# --- Created by Ebean DDL")
|| content.startsWith("-- Created by Ebean DDL")) {
environment.getFile("conf/evolutions/" + key).mkdirs();
if (!content.equals(evolutionScript)) {
Files.write(
Expand Down Expand Up @@ -104,14 +106,14 @@ private static String generateScript(SpiEbeanServer spiServer) {
return null;
}

return "# --- Created by Ebean DDL\r\n"
+ "# To stop Ebean DDL generation, remove this comment and start using Evolutions\r\n"
return "-- Created by Ebean DDL\r\n"
+ "-- To stop Ebean DDL generation, remove this comment (both lines) and start using Evolutions\r\n"
+ "\r\n"
+ "# --- !Ups\r\n"
+ "-- !Ups\r\n"
+ "\r\n"
+ ups
+ "\r\n"
+ "# --- !Downs\r\n"
+ "-- !Downs\r\n"
+ "\r\n"
+ downs;
}
Expand Down

0 comments on commit 7e600cf

Please sign in to comment.