Switching sqlalchemy structure to the declarative method.
Free translation: I screwed it all up now.