Closes #17; Fixed migrations
This commit is contained in:
parent
4f6c99f211
commit
cd9e4187f7
1
main.py
1
main.py
@ -49,6 +49,7 @@ def main() -> None:
|
|||||||
|
|
||||||
# Perform migration if command line argument was provided
|
# Perform migration if command line argument was provided
|
||||||
if args.migrate:
|
if args.migrate:
|
||||||
|
logger.info("Performing migrations...")
|
||||||
migrate_database()
|
migrate_database()
|
||||||
|
|
||||||
intents: Intents = Intents().all()
|
intents: Intents = Intents().all()
|
||||||
|
@ -30,11 +30,11 @@ class Migration(BaseMigration):
|
|||||||
exc,
|
exc,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.db.groups.update_many(
|
self.db.users.update_many(
|
||||||
{"customchannel": {"$exists": True}},
|
{"customchannel": {"$exists": True}},
|
||||||
{"$rename": {"customchannel": "custom_channel"}},
|
{"$rename": {"customchannel": "custom_channel"}},
|
||||||
)
|
)
|
||||||
self.db.groups.update_many(
|
self.db.users.update_many(
|
||||||
{"customrole": {"$exists": True}},
|
{"customrole": {"$exists": True}},
|
||||||
{"$rename": {"customrole": "custom_role"}},
|
{"$rename": {"customrole": "custom_role"}},
|
||||||
)
|
)
|
||||||
@ -69,11 +69,11 @@ class Migration(BaseMigration):
|
|||||||
exc,
|
exc,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.db.test_collection.update_many(
|
self.db.users.update_many(
|
||||||
{"custom_channel": {"$exists": True}},
|
{"custom_channel": {"$exists": True}},
|
||||||
{"$rename": {"custom_channel": "customchannel"}},
|
{"$rename": {"custom_channel": "customchannel"}},
|
||||||
)
|
)
|
||||||
self.db.test_collection.update_many(
|
self.db.users.update_many(
|
||||||
{"custom_role": {"$exists": True}},
|
{"custom_role": {"$exists": True}},
|
||||||
{"$rename": {"custom_role": "customrole"}},
|
{"$rename": {"custom_role": "customrole"}},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user