diff --git a/src/main/scala/servlet/AutoUpdateListener.scala b/src/main/scala/servlet/AutoUpdateListener.scala index c0eb126..e9d1e82 100644 --- a/src/main/scala/servlet/AutoUpdateListener.scala +++ b/src/main/scala/servlet/AutoUpdateListener.scala @@ -53,7 +53,21 @@ * The history of versions. A head of this sequence is the current BitBucket version. */ val versions = Seq( - new Version(2, 7), + new Version(2, 7) { + override def update(conn: Connection): Unit = { + super.update(conn) + using(conn.createStatement.executeQuery("SELECT USER_NAME, REPOSITORY_NAME FROM REPOSITORY")){ rs => + while(rs.next){ + defining(Directory.getAttachedDir(rs.getString("USER_NAME"), rs.getString("REPOSITORY_NAME"))){ newDir => + val oldDir = new File(newDir.getParentFile, "issues") + if(oldDir.exists && oldDir.isDirectory){ + oldDir.renameTo(newDir) + } + } + } + } + } + }, new Version(2, 6), new Version(2, 5), new Version(2, 4), diff --git a/src/main/scala/util/Directory.scala b/src/main/scala/util/Directory.scala index 920b22a..9008171 100644 --- a/src/main/scala/util/Directory.scala +++ b/src/main/scala/util/Directory.scala @@ -48,7 +48,7 @@ * Directory for files which are attached to issue. */ def getAttachedDir(owner: String, repository: String): File = - new File(s"${RepositoryHome}/${owner}/${repository}/issues") + new File(s"${RepositoryHome}/${owner}/${repository}/comments") /** * Directory for uploaded files by the specified user.