mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixed migrations
This commit is contained in:
parent
a581bba757
commit
caf44345c1
|
@ -11,6 +11,7 @@ from src.migrations.utils import return_example_file
|
|||
logger = logging.getLogger("rcgcdw.migrations.1.13.1.1")
|
||||
new_settings = settings.copy()
|
||||
|
||||
|
||||
def run():
|
||||
if "event_appearance" not in settings:
|
||||
logger.info("Running migration 1.13.1.1")
|
||||
|
@ -34,8 +35,8 @@ def run():
|
|||
except KeyError:
|
||||
logger.exception("Failed to migrate appearance embed.")
|
||||
sys.exit(1)
|
||||
shutil.copy(command_args.settings, command_args.settings+".{}.bak".format(int(time.time())))
|
||||
with open(command_args.settings, "w", encoding="utf-8") as new_write:
|
||||
shutil.copy(command_args.settings.name, "{}.{}.bak".format(command_args.settings.name, int(time.time())))
|
||||
with open(command_args.settings.name, "w", encoding="utf-8") as new_write:
|
||||
new_write.write(json.dumps(new_settings, indent=4))
|
||||
load_settings()
|
||||
logger.info("Migration 1.13.1.1 has been successful.")
|
||||
|
|
|
@ -30,8 +30,8 @@ def run():
|
|||
sys.exit(1)
|
||||
if change:
|
||||
logger.info("Running migration falsytypes")
|
||||
shutil.copy(command_args.settings, command_args.settings+".{}.bak".format(int(time.time())))
|
||||
with open(command_args.settings, "w", encoding="utf-8") as new_write:
|
||||
shutil.copy(command_args.settings.name, "{}.{}.bak".format(command_args.settings.name, int(time.time())))
|
||||
with open(command_args.settings.name, "w", encoding="utf-8") as new_write:
|
||||
new_write.write(json.dumps(new_settings, indent=4))
|
||||
load_settings()
|
||||
logger.info("Migration falsytypes has been successful.")
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
# You have been warned
|
||||
|
||||
import time, logging.config, requests, datetime, math, os.path, sys, importlib
|
||||
|
||||
import src.misc
|
||||
import src.configloader
|
||||
from src.migrations import *
|
||||
from collections import defaultdict, Counter, OrderedDict
|
||||
from src.argparser import command_args
|
||||
from typing import Optional
|
||||
|
|
Loading…
Reference in a new issue