From 00ea8ec2c60c3c024138c518bd51d9d5fcc370a6 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 8 Oct 2020 22:19:55 +0500 Subject: [PATCH] tables for new backup schedules --- .../templates/baseTemplate/index.html | 6 +- plogical/upgrade.py | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 22e293ba5..915172653 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -585,12 +585,12 @@
  • {% trans "Add/Delete Destination" %}
  • -
  • {% trans "Setup Google Drive" %} -
  • {% trans "Schedule Back up" %}
  • +
  • {% trans "Setup Google Drive" %} +
  • {% trans "Remote Back ups" %}
  • diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 846741315..e2525d114 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -653,6 +653,66 @@ imap_folder_list_limit = 0 except: pass + query = """CREATE TABLE `websiteFunctions_normalbackupdests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(25) NOT NULL, + `config` longtext NOT NULL, + PRIMARY KEY (`id`) +)""" + + try: + cursor.execute(query) + except: + pass + + query = """CREATE TABLE `websiteFunctions_normalbackupjobs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(25) NOT NULL, + `config` longtext NOT NULL, + `owner_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `websiteFunctions_nor_owner_id_3a7a13db_fk_websiteFu` (`owner_id`), + CONSTRAINT `websiteFunctions_nor_owner_id_3a7a13db_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_normalbackupdests` (`id`) +)""" + + try: + cursor.execute(query) + except: + pass + + + query = """CREATE TABLE `websiteFunctions_normalbackupsites` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `domain_id` int(11) NOT NULL, + `owner_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `websiteFunctions_nor_domain_id_c03362bc_fk_websiteFu` (`domain_id`), + KEY `websiteFunctions_nor_owner_id_c6ece6cc_fk_websiteFu` (`owner_id`), + CONSTRAINT `websiteFunctions_nor_domain_id_c03362bc_fk_websiteFu` FOREIGN KEY (`domain_id`) REFERENCES `websiteFunctions_websites` (`id`), + CONSTRAINT `websiteFunctions_nor_owner_id_c6ece6cc_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_normalbackupjobs` (`id`) +)""" + + try: + cursor.execute(query) + except: + pass + + + query = """CREATE TABLE `websiteFunctions_normalbackupjoblogs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `status` int(11) NOT NULL, + `message` longtext NOT NULL, + `owner_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `websiteFunctions_nor_owner_id_69403e73_fk_websiteFu` (`owner_id`), + CONSTRAINT `websiteFunctions_nor_owner_id_69403e73_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_normalbackupjobs` (`id`) +)""" + + try: + cursor.execute(query) + except: + pass + try: connection.close() except: