From: Marek Stępniowski Date: Tue, 7 Oct 2008 10:31:46 +0000 (+0200) Subject: Removed old migrations (older than south). X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/59b65a24cec4ac67848293297f3bb1bd6cf99872?ds=inline;hp=-c Removed old migrations (older than south). --- 59b65a24cec4ac67848293297f3bb1bd6cf99872 diff --git a/migrations/001_add_book_count_to_shelf.py b/migrations/001_add_book_count_to_shelf.py deleted file mode 100644 index 4af55a172..000000000 --- a/migrations/001_add_book_count_to_shelf.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.core.management import setup_environ -import settings - -setup_environ(settings) - -from catalogue.models import Tag, Book -from django.db import connection - -query = 'ALTER TABLE catalogue_tag ADD COLUMN book_count integer NOT NULL DEFAULT 0' - -cursor = connection.cursor() -cursor.execute(query) - -for shelf in Tag.objects.filter(category='set'): - shelf.book_count = len(Book.tagged.with_all(shelf)) - shelf.save()