(refs #18)Add schema update to fix constraints for COLLABORATOR.

This commit is contained in:
takezoe
2013-07-04 18:46:01 +09:00
parent 869930165c
commit 47bdb8da23
2 changed files with 13 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ object AutoUpdate {
* Version of GitBucket
*
* @param majorVersion the major version
* @param minorVersion the minor version
* @param minorVersion the minor version
*/
case class Version(majorVersion: Int, minorVersion: Int){
@@ -22,7 +22,7 @@ object AutoUpdate {
/**
* Execute update/MAJOR_MINOR.sql to update schema to this version.
* If corresponding SQL file does not exist, this method do nothing.
* If corresponding SQL file does not exist, this method do nothing.
*/
def update(conn: Connection): Unit = {
val sqlPath = "update/%d_%d.sql".format(majorVersion, minorVersion)
@@ -40,7 +40,7 @@ object AutoUpdate {
}
/**
* MAJOR.MINOR
* MAJOR.MINOR
*/
val versionString = "%d.%d".format(majorVersion, minorVersion)
}
@@ -49,6 +49,7 @@ object AutoUpdate {
* The history of versions. A head of this sequence is the current BitBucket version.
*/
val versions = Seq(
Version(1, 1),
Version(1, 0)
)
@@ -84,7 +85,7 @@ object AutoUpdate {
}
/**
* Start H2 database and update schema automatically.
* Start H2 database and update schema automatically.
*/
class AutoUpdateListener extends org.h2.server.web.DbStarter {
import AutoUpdate._