Verified Commit faf697d3 authored by ynerant's avatar ynerant
Browse files

Drop unusued models. Keep migration script, but this is now unusable

parent b0a1602e
Pipeline #9521 passed with stages
in 2 minutes and 36 seconds
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),
......
# 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',
),
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment