From faf697d3cfede753dac956147b851da889792183 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 2 Nov 2021 12:55:03 +0100 Subject: [PATCH] Drop unusued models. Keep migration script, but this is now unusable --- .../commands/migrate_to_new_format.py | 10 +++- media/migrations/0044_auto_20211102_1254.py | 58 +++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 media/migrations/0044_auto_20211102_1254.py diff --git a/media/management/commands/migrate_to_new_format.py b/media/management/commands/migrate_to_new_format.py index da0a60a..c718b3f 100644 --- a/media/management/commands/migrate_to_new_format.py +++ b/media/management/commands/migrate_to_new_format.py @@ -1,8 +1,7 @@ from django.core.management import BaseCommand from django.db import transaction from django.utils.translation import gettext_lazy as _ -from media.models import CD, Comic, Game, Manga, Novel, Review, Vinyl, \ - OldCD, OldComic, OldGame, OldManga, OldNovel, OldReview, OldVinyl +from media.models import CD, Comic, Game, Manga, Novel, Review, Vinyl from tqdm import tqdm @@ -17,6 +16,13 @@ class Command(BaseCommand): @transaction.atomic def handle(self, *args, **options): # noqa: C901 + self.stderr.write(self.style.WARNING( + "Old data structure has been deleted. This script won't work " + "anymore (and is now useless)")) + + from media.models import OldCD, OldComic, OldGame, OldManga, OldNovel, \ + OldReview, OldVinyl + # Migrate books for old_book_class, book_class in [(OldComic, Comic), (OldManga, Manga), diff --git a/media/migrations/0044_auto_20211102_1254.py b/media/migrations/0044_auto_20211102_1254.py new file mode 100644 index 0000000..a41071f --- /dev/null +++ b/media/migrations/0044_auto_20211102_1254.py @@ -0,0 +1,58 @@ +# Generated by Django 2.2.24 on 2021-11-02 11:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('media', '0043_auto_20211023_2012'), + ] + + operations = [ + migrations.RemoveField( + model_name='oldcd', + name='authors', + ), + migrations.RemoveField( + model_name='oldcomic', + name='authors', + ), + migrations.RemoveField( + model_name='oldgame', + name='owner', + ), + migrations.RemoveField( + model_name='oldmanga', + name='authors', + ), + migrations.RemoveField( + model_name='oldnovel', + name='authors', + ), + migrations.DeleteModel( + name='OldReview', + ), + migrations.RemoveField( + model_name='oldvinyl', + name='authors', + ), + migrations.DeleteModel( + name='OldCD', + ), + migrations.DeleteModel( + name='OldComic', + ), + migrations.DeleteModel( + name='OldGame', + ), + migrations.DeleteModel( + name='OldManga', + ), + migrations.DeleteModel( + name='OldNovel', + ), + migrations.DeleteModel( + name='OldVinyl', + ), + ]