Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ public static Path getMigrationsDirectory() throws URISyntaxException, IOExcepti
return Path.of(uri);
} catch (FileSystemNotFoundException e) {
Map<String, String> env = new HashMap<>();
try (FileSystem dir = FileSystems.newFileSystem(uri, env)) {
return dir.getPath("/database/migrations/");
}
FileSystem dir = FileSystems.newFileSystem(uri, env);
return dir.getPath("/database/migrations/");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void execute(@NotNull SlashCommandInteractionEvent event) {
return;
}
String sql = Files.readString(migrationFile);
migrationsDir.getFileSystem().close();
String[] statements = sql.split("\\s*;\\s*");
if (statements.length == 0) {
Responses.error(event, "The migration `" + migrationName + "` does not contain any statements. Please remove or edit it before running again.").queue();
Expand Down