mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
DBCreator: Fix ScriptRunner to strip comments, reformat code
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
6d155416c2
commit
ef07cde449
@ -31,17 +31,15 @@ import com.cloud.utils.component.SystemIntegrityChecker;
|
|||||||
import com.cloud.utils.db.ScriptRunner;
|
import com.cloud.utils.db.ScriptRunner;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
|
|
||||||
/**
|
// Creates the CloudStack Database by using the 4.0 schema and apply
|
||||||
* Creates the CloudStack Database by using the 4.0 schema and apply
|
// upgrade steps to it.
|
||||||
* upgrade steps to it.
|
|
||||||
*/
|
|
||||||
public class DatabaseCreator {
|
public class DatabaseCreator {
|
||||||
protected static void printHelp(String cmd) {
|
protected static void printHelp(String cmd) {
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"DatabaseCreator creates the database schema by removing the \n" +
|
"DatabaseCreator creates the database schema by removing the \n" +
|
||||||
"previous schema, creating the schema, and running \n" +
|
"previous schema, creating the schema, and running \n" +
|
||||||
"through the database updaters.");
|
"through the database updaters.");
|
||||||
System.out.println("Usage: " + cmd + " [initial schema file] [database upgrade class]");
|
System.out.println("Usage: " + cmd + " [schema files] [database upgrade class]");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@ -170,6 +170,10 @@ public class ScriptRunner {
|
|||||||
}
|
}
|
||||||
Thread.yield();
|
Thread.yield();
|
||||||
} else {
|
} else {
|
||||||
|
int idx = line.indexOf("--");
|
||||||
|
if (idx != -1)
|
||||||
|
command.append(line.substring(0, idx));
|
||||||
|
else
|
||||||
command.append(line);
|
command.append(line);
|
||||||
command.append(" ");
|
command.append(" ");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user