Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Creating new tables.

Quote Reply
Creating new tables.
Hi,

Is there a easy way to create new tables in Links SQL??? I know that SQL.cgi creates the tables originally, but if I run that it will screw up the other tables.

I can't find an easy way to do it in DBSQL.pm either... has anyone found any code already there to make adding tables easy? If you have please tell me which file its in...

Thanks!

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------




Quote Reply
Re: Creating new tables. In reply to
Hi Michael,

If you add the table into SQL.mysql (you are using version 1.1?) and then run setup.cgi and click on create table it will create it for you (and your other tables will be unaffected).

Cheers,

Alex
Quote Reply
Re: Creating new tables. In reply to
Thanks!

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------




Quote Reply
Re: Creating new tables. In reply to
That's a good hint... I was doing that (but didn't want to publish that in case there was a problem).

_BUT_ one thing --- Make a back up of your .def files (the DEF directory) before you do it. The .def files are automatically re-created when the "create" is run, even if the table create fails.

You lose your weights, and customizations.

So, all you need to do, is edit the SQL.mysql file to add the new table.

make a copy of your DEFS directory (I just make a "hold" subdirectory and cp * hold)

Then, run the setup.cgi

BEFORE doing anything in the admin, copy the files from the hold subdirectory back ... cp hold\* .)

Then, you are set.

Alex has promised more flexibilty in a future release of the admin/setup scripts, so there may be a better way soon.

To MODIFY/ALTER a table, just use the table editor built in to Links/Admin

BTW..... when you have a free moment, it's a good idea to dump the structure of your current database configuration, and then paste any of the changes you've made into the SQL.mysql file, and save it as my_SQL.mysql or something similar.

That way, if you need to recreate your databases for any reason (like switching hosts) you'll have an up-to-date automated script. (You'll just run set up, copy your old .def files over the new ones, import your database, and you're up and running) ((of course you could always do a mysqldump ... but sometimes you have to get out of Dodge with only your off-line backups)).

If you _don't_ update your SQL.mysql file with the changes (field additions, name changes, etc) you make to the Links database, you'll have to manually reconstruct it each time.

But, if Alex says it's ok to run setup.cgi again, AS LONG AS YOU DON'T DROP TABLES!!!! then I offer my experiences without warantee of any sort!

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Quote Reply
Re: Creating new tables. In reply to
I wish there was a web interface so you can just select to restore the latest back up and click go Smile

This ways easy enough though... Anyways - I have to concentrate on my PNG Graphs for the time being...

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------