Skip to content

Commit 6558019

Browse files
DB setup: support db schema creation (with --schema-only) without force recreate option
1 parent ac8c200 commit 6558019

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup/bindir/cloud-setup-databases.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ for full help
199199
self.info("No mysql root user specified, will not create Cloud DB schema\n", None)
200200
return
201201

202+
if self.areCloudDatabasesCreated() and not self.options.schemaonly and not self.options.forcerecreate:
203+
self.errorAndExit("Aborting script as the databases (cloud, cloud_usage) already exist.\n" \
204+
"Please use the --force-recreate parameter if you want to recreate the schemas.")
205+
202206
replacements = (
203207
("CREATE USER cloud identified by 'cloud';",
204208
"CREATE USER %s@`localhost` identified by '%s'; CREATE USER %s@`%%` identified by '%s';"%(
@@ -239,10 +243,6 @@ for full help
239243
("DROP USER 'cloud'@'%' ;", "DO NULL;")
240244
)
241245

242-
if self.areCloudDatabasesCreated() and not self.options.forcerecreate:
243-
self.errorAndExit("Aborting script as the databases (cloud, cloud_usage) already exist.\n" \
244-
"Please use the --force-recreate parameter if you want to recreate the schemas.")
245-
246246
scriptsToRun = ["create-database","create-schema", "create-database-premium","create-schema-premium"]
247247
if self.options.schemaonly:
248248
scriptsToRun = ["create-schema", "create-schema-premium"]

0 commit comments

Comments
 (0)