1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-27 10:13:02 +00:00

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

This commit is contained in:
Yohann D'ANELLO 2021-11-02 12:55:03 +01:00
parent b0a1602ea2
commit faf697d3cf
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 66 additions and 2 deletions

View File

@ -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),

View File

@ -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',
),
]