﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	parents
914	Use named ForeignKeys in migrations	Elrond		"`db/migrations.py` has this:
{{{
from mediagoblin.db.models import (MediaEntry, Collection, MediaComment, User,
        Privilege)
}}}

This is a big NO! Those are the current variansts of those tables. Not the versions needed in any old migration. Those current tables could have changed in a completely unexpected way and break old migrations.

If there are migration docs, please add a note about this.

The current main use of the above imports is code like this:
{{{
creator = Column(Integer, ForeignKey(User.id), nullable=False)
}}}

This can be easily fixed:
{{{
creator = Column(Integer, ForeignKey('core__users.id'), nullable=False)
}}}

After fixing this, please make sure the migrations still work."	defect	new	critical	0.7.0	programming				
