Comments (12)
Hrm... that's not sounding positive. I'll check with winhamwr who provided the mysql patch
from easy-thumbnails.
Hrm indeed. I'll take a look at this and see what might be different about my environment.
from easy-thumbnails.
I get the same result, using MySQL
from easy-thumbnails.
I'm very willing to accept suggestions on what should be changed to fix this.
from easy-thumbnails.
well if you feel that the app is good where it is at right now, maybe its best to remove your migrations, remove the history from mysql southmigrations table, and then start fresh, meaning that you'll now only have one migration which should render a successful result...
from easy-thumbnails.
That is the plan when we hit beta. But it would be nice to have working transational migrations so that users can upgrade their database and then switch to beta, resetting the ghost migrations.
from easy-thumbnails.
Could the issue here be that some people are creating the tables as MyISAM, while others are creating them as InnoDB? Unless it's explicitly specified, the storage engine will be taken from the user's default - which is often MyISAM.
MyISAM doesn't support foreign keys, however:
"For storage engines other than InnoDB, MySQL Server parses the FOREIGN KEY syntax in CREATE TABLE statements, but does not use or store it."
So it can "create" them without throwing an error, but removing one might get the result reported here.
I'll try to test this theory as soon as get a few more minutes, but this has that flavor...
from easy-thumbnails.
Cheers, help is most appreciated :)
from easy-thumbnails.
That would make sense. I'm using InnoDB exclusively.
from easy-thumbnails.
I've now confirmed this - it's a MyISAM vs. InnoDB issue. Although MyISAM doesn't support foreign keys, it doesn't scream if you try to create them; deleting them, though, gets you an error.
Since many out-of-the-box installations of MySQL have MyISAM configured as the default table type - indeed, I think that's the default setting - I'd imagine it's a fairly common error condition.
Possible solutions:
-
As an earlier poster suggested, wrap the whole thing up in one migration, thereby obviating the need to remove keys.
-
I'm not sure if South lets you test for storage engines specifically - if so, then I suppose detect MyISAM and avoid those FK migrations accordingly.
-
Specifically tell the migrations to create the tables as InnoDB - not sure you can do that, though (sorry, haven't looked yet).
-
Just tell people to watch out and don't use MyISAM... it's bad for you anyway! (In this case at any rate).
As a sidenote, I imagine this sort of failure mode would be pretty common, so I'm wondering if there's another variable screwing it up here... I'll try to reduce it to a nicer test case later, but I've definitely confirmed that the error does or does not occur based on the default table type (and whether the tables get created as MyISAM or InnoDB) - so hopefully that helps resolve the immediate problems.
from easy-thumbnails.
I've just pulled a commit from stefanfoulis that should at least make forward migrations work.
from easy-thumbnails.
That's great! Thanks a lot
from easy-thumbnails.
Related Issues (20)
- Cant install easy-thumbnails with Poetry and Django 4 HOT 4
- Template fails to render due to ZeroDivisionError when input is corrupted
- ContentFile without a name breaks easy_thumbnails
- ANTIALIAS is deprecated and will be removed in Pillow 10
- svglib dependency is missing HOT 9
- Imoprt error
- Django 4.1 template tag 'thumbnail' conflict with sorl-thumbnails
- Saving TIFF image raises Value error HOT 2
- How to force a single field to convert the thumbails to JPG even if PNG with alpha was provided
- DeprecationWarning from get_storage_class HOT 1
- Lots of duplicated queries HOT 1
- Support for pillow >= 10.0.0.0 HOT 1
- SVG File.width - This backend doesn't support absolute paths. HOT 2
- ZeroDivisionError when thumbnail is passed a 0x0 SVG HOT 1
- Increase File name field length HOT 1
- Allow use of new Django4.2 STORAGE config
- animated gifs - preserve animation, as PIL/Pillow supports it HOT 3
- up to date docs?
- Data too long on serving thumbnails
- DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-thumbnails.