mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #564)Change the attached files directory to /commens from /issues
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user