/*
 * CollabNet Subversion Edge
 * Copyright (C) 2011, CollabNet Inc. All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *  
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.collabnet.svnedge.schema;

import org.apache.log4j.Logger;

import java.sql.SQLException;

public class MS009EnableCloudService implements MigrationScript {
    private Logger log = Logger.getLogger(getClass());

    public boolean migrate(SqlUtil db) throws SQLException {
        
        db.executeUpdateSql("update CLOUD_SERVICES_CONFIGURATION " +
                "set ENABLED = true");
        return false;
    }
    
    public int[] getVersion() {
        return new int[] {2,4,1};
    }
}

@@ -1077,26 +1077,525 @@
  %7B%0D%0A        
+// insert row, if it does not exist%0D%0A        db.executeUpdateSql(%22insert into CLOUD_SERVICES_CONFIGURATION %22 +%0D%0A                %22(select 1 as ID, 0 as VERSION, '' as DOMAIN, '' as USERNAME,%22 +%0D%0A                %22 '' as PASSWORD, true as ENABLED from %22 +%0D%0A                %22(select 1 as ID, count(*) from CLOUD_SERVICES_CONFIGURATION)%22 +%0D%0A                %22 where ID not in %22 +%0D%0A                %22(select ID from CLOUD_SERVICES_CONFIGURATION))%22);%0D%0A        // for installations where a row already existed
 %0D%0A
-
         db.e
@@ -1791,13 +1791,13 @@
 %5B%5D %7B
-2,4,1
+3,0,0
 %7D;%0D%0A

Enable cloud services by default