RDCEP / EDE

MIT License
2 stars 1 forks source link

Name of id columns on database tables #19

Closed njmattes closed 8 years ago

njmattes commented 8 years ago

@legendOfZelda Is it possible to change the database schema so that each table's primary_key is called id (rather than eg gid)? ForeignKeys would still take names like gid to distinguish themselves. See the following files in the db_ids branch for a sense of what I'm talking about:

ghost commented 8 years ago

i haven't used id so far because it's a keyword in python

njmattes commented 8 years ago

Fair enough. How about uid then, and perhaps slightly more verbose foreign key names. See the last commit on the db_ids branch (here and here).

ghost commented 8 years ago

yes, I'm fine with your schema. only minor suggestions:

njmattes commented 8 years ago

I'm fine with that. We should rip out the @declared_attr of the EDEBase object, and add __table_name__s back to the model objects. Do you want to do this refactor or want me to? I'm happy to do it—or to stay out of the way.

ghost commented 8 years ago

ok, i refined the schema and actually removed EDEBase to simplify + make the uid's and tablenames more explicitly visible in models.py which can't hurt, certainly not for the beginning.

njmattes commented 8 years ago

Works for me.