mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-12-23 10:38:58 +00:00
chore: escape backticks on db commands
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
parent
884a82d814
commit
8f20e5e00d
@ -73,7 +73,7 @@ def main():
|
||||
os.system(command)
|
||||
|
||||
# Grant permission to database
|
||||
command = mysql_command + "\"GRANT ALL PRIVILEGES ON `{db_name}`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;\"".format(
|
||||
command = mysql_command + "\"GRANT ALL PRIVILEGES ON \`{db_name}\`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;\"".format(
|
||||
db_name=site_config.get('db_name')
|
||||
)
|
||||
os.system(command)
|
||||
|
@ -60,13 +60,13 @@ def restore_database(files_base, site):
|
||||
)
|
||||
|
||||
# drop db if exists for clean restore
|
||||
drop_database = mysql_command + "\"DROP DATABASE IF EXISTS `{db_name}`;\"".format(
|
||||
drop_database = mysql_command + "\"DROP DATABASE IF EXISTS \`{db_name}\`;\"".format(
|
||||
db_name=site_config.get('db_name')
|
||||
)
|
||||
os.system(drop_database)
|
||||
|
||||
# create db
|
||||
create_database = mysql_command + "\"CREATE DATABASE IF NOT EXISTS `{db_name}`;\"".format(
|
||||
create_database = mysql_command + "\"CREATE DATABASE IF NOT EXISTS \`{db_name}\`;\"".format(
|
||||
db_name=site_config.get('db_name')
|
||||
)
|
||||
os.system(create_database)
|
||||
@ -86,7 +86,7 @@ def restore_database(files_base, site):
|
||||
os.system(set_user_password)
|
||||
|
||||
# grant db privileges to user
|
||||
grant_privileges = mysql_command + "\"GRANT ALL PRIVILEGES ON `{db_name}`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;\"".format(
|
||||
grant_privileges = mysql_command + "\"GRANT ALL PRIVILEGES ON \`{db_name}\`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;\"".format(
|
||||
db_name=site_config.get('db_name')
|
||||
)
|
||||
os.system(grant_privileges)
|
||||
|
Loading…
Reference in New Issue
Block a user