Data model for user accounts

Registered by Thomas Ingham

User accounts should be authenticated using email address and a private password. Usernames should be customizable such that they are not required to be unique. Additional "Profile" data could be: { homepage, bio, photo link, aim/msn/jabber/irc@server }

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Thomas Ingham
Direction:
Needs approval
Assignee:
Kai Blin
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Kai Blin
Completed by
Kai Blin

Related branches

Sprints

Whiteboard

I think it probably makes sense here to split our users table into a dedicated authentication table; and a second table for any of the extra information. Who knows what keys we're going to want to allow users to add to their profiles down the road; and we definitely want authentication to be snappy.

What are your thoughts on moving this to support an RDBMS?

WOMBAT is using SqlAlchemy to connect to the database. Switching to e.g. MySQL should be as easy as setting the sqlalchemy.default.url to mysql://url/to/db, haven't tried that yet, though.

The User table looks like this so far:
CREATE TABLE users (
        id INTEGER NOT NULL,
        email VARCHAR(255),
        password VARCHAR(255),
        PRIMARY KEY (id)
);

We can add a 1:1 relation to a user_data table
CREATE TABLE user_data (
        id INTEGER NOT NULL,
        name VARCHAR(255),
        nick VARCHAR(255),
        vcs_user VARCHAR(255),
        vcs_pass VARCHAR(255),
        user_id INTEGER,
        PRIMARY KEY(id),
        FOREIGN KEY (user_id) REFERENCES users (id)
);

[thomas.ingham]
Sept. 19, 2008 12:40am.
In the class file for User and UserData I can see that you're using a consistent method for building out the data representations however; in searching google for samples I couldn't see how you were building these models in regards to a published spec. As such I hesitated to edit them to add in any of what appeared to be required for the Mapper to understand the joins completely. This could be related to my lack of experience with Python/Pylons/SQLAlchemy in general, or maybe we just haven't hit that point yet. The model they demonstrate on http://tinyurl.com/43w47v seems pretty simple but it just didn't have enough in common with what I was seeing in the py in wombat so.. I saw the black diamonds and I'm taking the bunny course.
If you can just implement the joins I can finish the form and report for edit and index.
[/thomas.ingham]

[kai.blin]
Sept. 20, 2008
Now that this was cleared up, marking this blueprint as implemented as discussed on IRC.
[/kai.blin]

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.