Forum OpenACS Q&A: Urgent! Need help with data model!

Collapse
Posted by Ravi Gadad on
I already asked this, but no one responded, and I'm sort of
hanging by a thread, so please - someone help!  My very
important urgent question - how do I modify the data model so
that screen names are not null? I want to use screen names
primarily, for logins and to distinguish users. Do I need to drop
the users table and recreate it? And if so, what's the proper
procedure to do a dump and then restore the data?

Thanks!

Also, Is there a module in OpenACS that asks for demographic
information? Where can I find it? I can't seem to locate it in the
WWW directory. I also have some questions about the
timestamp data type.. how do I insert a user-specified birthdate
into the users_demographics table under birthdate? And
conversely, I need to find out a user's birthyear (just the four digit
year, i.e. 1975).. how do I pull that from the database?

Collapse
Posted by Bob OConnor on

Ravi, Basically new records are added to the users table only when registering. so I would modify the tcl file that does this: /register/user-new-2.tcl. Just add a field to the statement:

set insert_statement "insert into users (user_id...

No need to drop the users table.... There already is a field: "screen_name". So for existing records you could fill them with unique names like this in psql: (this may not be exact syntax).

update users set screen_name=users.user_id;

Be careful with above. It will change ALL user records in the table.

To see all the tables in the system, from psql
type: d or for the fields in users_contact
type: d users_contact.

Check out the documentation at www.postgresql.org there is a good pdf book there that will help you learn sql. Also check out www.primenet.com/~cohen/arsdigita for some great basics by David Cohen.

-Bob