mirror of https://github.com/apache/cloudstack.git
Write the current schema level out to the database when doing deploydb or setup-databases
This commit is contained in:
parent
8c5268d72d
commit
a0d724cc33
|
|
@ -352,3 +352,10 @@ if rootuser:
|
|||
print "Applying file %s to the database on server %s:%s"%(p,host,port)
|
||||
try: run_mysql(text,rootuser,rootpassword,host,port)
|
||||
except CalledProcessError: sys.exit(22)
|
||||
|
||||
p = os.path.join(dbfilepath,"schema-level.sql")
|
||||
if os.path.isfile(p):
|
||||
text = file(p).read()
|
||||
print "Applying file %s to the database on server %s:%s"%(p,host,port)
|
||||
try: run_mysql(text,rootuser,rootpassword,host,port)
|
||||
except CalledProcessError: sys.exit(22)
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Hidden', 'DEFAULT', 'database', 'schema.level', '2.1.3', 'The schema level of this database');
|
||||
6
wscript
6
wscript
|
|
@ -735,6 +735,12 @@ def deploydb(ctx,virttech=None):
|
|||
after = after + file(p).read()
|
||||
Utils.pprint("GREEN","Reading database code from %s"%p)
|
||||
|
||||
p = _join("setup","db","schema-level.sql")
|
||||
if _exists(p):
|
||||
p = dev_override(p)
|
||||
after = after + file(p).read()
|
||||
Utils.pprint("GREEN","Reading database code from %s"%p)
|
||||
|
||||
cmd = ["mysql","--user=%s"%dbuser,"-h",dbhost,"--password=%s"%dbpw]
|
||||
Utils.pprint("GREEN","Deploying post-configuration database scripts to %s (user %s)"%(dbhost,dbuser))
|
||||
Utils.pprint("BLUE"," ".join(cmd))
|
||||
|
|
|
|||
Loading…
Reference in New Issue