> > You missed his point.  When you use the steps in the FAQ to alter
> > a table, one of the steps involves deleting it.  When you do that
> > SQLite also deletes all existing triggers and indices on the
> > table.
> > 
> > Consequently one piece of code that is simple (alter table)
> suddenly has 
> > to be aware of a lot more other things.  It
> > is all a simple matter of programming, but makes the code
> > more coupled, complex and brittle.

True, but it's important to know the database structure, and
why it was made the way it was, before you start changing it.

> > 
> 
> Before doing the "DELETE TABLE t1" you can run this query:
> 
>     SELECT sql FROM sqlite_master WHERE tbl_name!=name AND
> tbl_name='t1';
> 
> That query will give you the complete text of all CREATE INDEX
> and CREATE TRIGGER statements associated with table t1.  Save
> these results.  Then delete table t1 and recreate it in its
> new form.  Then rerun the CREATE INDEX and CREATE TRIGGER
> statements that you saved.  This will automatically recreate
> all of your indices and triggers.

Very useful info! Thanks everyone :)



=====

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

"Lord Tarlington gazed upon the crazed Egyptian hieroglyphics on the walls of 
the ancient tomb of the petrified pharaoh, he vowed there would be no curse on 
him like on that other Lord, unless you count his marriage to Lady Tarlington 
who, when the lost treasure was found, will be dumped faster than that basket 
in the bulrushes."
  Melissa Rhodes
---------------------------------

The Castles of Dereth Calendar: a tour of the art and architecture of Asheron's 
Call
http://www.lulu.com/content/77264


                
__________________________________ 
Do you Yahoo!? 
Send holiday email and support a worthy cause. Do good. 
http://celebrity.mail.yahoo.com

Reply via email to