(refs #8)Add DDL to add new table and columns for group management.

This commit is contained in:
takezoe
2013-07-22 17:15:12 +09:00
parent 6fd1a990ae
commit 1682eb3915
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
CREATE TABLE GROUP_MEMBER(
GROUP_NAME VARCHAR(100) NOT NULL,
USER_NAME VARCHAR(100) NOT NULL
);
ALTER TABLE GROUP_MEMBER ADD CONSTRAINT IDX_GROUP_MEMBER_PK PRIMARY KEY (GROUP_NAME, USER_NAME);
ALTER TABLE GROUP_MEMBER ADD CONSTRAINT IDX_GROUP_MEMBER_FK0 FOREIGN KEY (GROUP_NAME) REFERENCES ACCOUNT (USER_NAME);
ALTER TABLE GROUP_MEMBER ADD CONSTRAINT IDX_GROUP_MEMBER_FK1 FOREIGN KEY (USER_NAME) REFERENCES ACCOUNT (USER_NAME);
ALTER TABLE ACCOUNT ADD COLUMN GROUP_ACCOUNT BOOLEAN NOT NULL DEFAULT FALSE;

View File

@@ -49,6 +49,7 @@ object AutoUpdate {
* The history of versions. A head of this sequence is the current BitBucket version. * The history of versions. A head of this sequence is the current BitBucket version.
*/ */
val versions = Seq( val versions = Seq(
Version(1, 4),
new Version(1, 3){ new Version(1, 3){
override def update(conn: Connection): Unit = { override def update(conn: Connection): Unit = {
super.update(conn) super.update(conn)
@@ -128,6 +129,7 @@ class AutoUpdateListener extends org.h2.server.web.DbStarter {
} catch { } catch {
case ex: Throwable => { case ex: Throwable => {
logger.error("Failed to schema update", ex) logger.error("Failed to schema update", ex)
ex.printStackTrace()
conn.rollback() conn.rollback()
} }
} }