Gossamer Forum
Home : Products : DBMan : Installation :

Adding fields to a live database

Quote Reply
Adding fields to a live database
I think I already know the answer to this, but I'll ask anyway. I have my DBMAN Alumni database live now, and want to add some fields. Is there a problem with adding more fields - do I need to add them at the end, or is there some specific way to do this to keep from messing up my database?

TIA


------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX
Quote Reply
Re: Adding fields to a live database In reply to
I could be wrong, bot to the best of my knowledge you will have to manually edit the existing database to give those records the new fields, whether they be NULL or you have data for them.

All you would have to do then is edit the .cfg file, then add the fields to the html file, and then edit the database itself.

Hope that helps. Smile
Quote Reply
Re: Adding fields to a live database In reply to
Yeah, once you get a database started, you'll have to manually edit the database.

So what I've learned to do, is to include extra fields before I get a new database running. Like:

Blank1 => [35, 'alpha', 0, 255, 0, '',
Blank2 => [36, 'alpha', 0, 255, 0, '',
Blank3 => [37, 'alpha', 0, 255, 0, ''

and rename them if I need them later.

Quote Reply
Re: Adding fields to a live database In reply to
You know, I was thinking, there are text editor programs that can record macros. I think textpad.com has one that does.

To add more fields to a live database, you would have to add more | pipes to each entry.

You might be able to record a macro that hits the end key, add a |,and then the down arrow.
Quote Reply
Re: Adding fields to a live database In reply to
Actually, if adding the extra pipes to the end of the records is all that is needed, there are SEVERAL tools in UNIX that I can do that with. Thanks for the help, everybody!



------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX
Quote Reply
Re: Adding fields to a live database In reply to
All you have to do is add extra pipes to the end of the line. A search and replace in Textpad (replace '\n' with '| ||\n' to add three new fields). Should be just as easy in other tools as well.

You will need to update the config and the html.pl as well of course.

Cheers,

Alex
Quote Reply
Re: Adding fields to a live database In reply to
Thanks Alex.

Here is how I did this in UNIX.

while read LINE
do
echo "$LINE| || || |" >> alumni.db.new
done<alumni.db

This creates a new file , alumni.db.new
I then checked to make sure it did what I want, then

mv alumni.db.new alumni.db

to make the new file the production file.

Thanks for everybodys' help on this and other issues.

Jamie


------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX
Quote Reply
Re: Adding fields to a live database In reply to
Alex wrote a script for the links upgrade that I think would also work in this situation, just take out the line that replaces NULL with blanks, then you can add two pipes to the end. Just run update.pl in the directory with the DB in it.
Mike


------------------