mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-12-25 05:42:24 +00:00
Drop unusued models. Keep migration script, but this is now unusable
This commit is contained in:
parent
b0a1602ea2
commit
faf697d3cf
@ -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),
|
||||
|
58
media/migrations/0044_auto_20211102_1254.py
Normal file
58
media/migrations/0044_auto_20211102_1254.py
Normal 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',
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue
Block a user