movethreads.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from ... import attachments, polls, threads
  2. from ..base import BaseCommand
  3. class Command(BaseCommand):
  4. help = "Moves threads and posts from Misago 0.5"
  5. def handle(self, *args, **options):
  6. self.stdout.write("Moving threads from Misago 0.5:")
  7. self.start_timer()
  8. threads.move_threads(self.stdout, self.style)
  9. self.stdout.write(
  10. self.style.SUCCESS("Moved threads in %s" % self.stop_timer()))
  11. self.start_timer()
  12. threads.move_posts()
  13. self.stdout.write(
  14. self.style.SUCCESS("Moved posts in %s" % self.stop_timer()))
  15. self.start_timer()
  16. threads.move_mentions()
  17. self.stdout.write(
  18. self.style.SUCCESS("Moved mentions in %s" % self.stop_timer()))
  19. self.start_timer()
  20. threads.move_edits()
  21. self.stdout.write(
  22. self.style.SUCCESS("Moved edits histories in %s" % self.stop_timer()))
  23. self.start_timer()
  24. threads.move_likes()
  25. self.stdout.write(
  26. self.style.SUCCESS("Moved likes in %s" % self.stop_timer()))
  27. self.start_timer()
  28. attachments.move_attachments(self.stdout, self.style)
  29. self.stdout.write(
  30. self.style.SUCCESS("Moved attachments in %s" % self.stop_timer()))
  31. self.start_timer()
  32. polls.move_polls()
  33. self.stdout.write(
  34. self.style.SUCCESS("Moved polls in %s" % self.stop_timer()))
  35. self.start_timer()
  36. threads.move_participants()
  37. self.stdout.write(
  38. self.style.SUCCESS("Moved threads participants in %s" % self.stop_timer()))
  39. self.start_timer()
  40. threads.clean_private_threads(self.stdout, self.style)
  41. self.stdout.write(
  42. self.style.SUCCESS("Cleaned private threads in %s" % self.stop_timer()))