(refs #564)Change the attached files directory to /commens from /issues

This commit is contained in:
takezoe
2014-11-28 00:20:46 +09:00
parent c23985c1a7
commit 63627fc1d0
2 changed files with 16 additions and 2 deletions

View File

@@ -53,7 +53,21 @@ object AutoUpdate {
* 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),

View File

@@ -48,7 +48,7 @@ object Directory {
* 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.