"Scott Hess" <[EMAIL PROTECTED]> wrote:
> I was getting ready to checkin the rowid-versus-fts2 fix, and wanted
> to add one last bit, to upgrade older tables.
> 
> Unfortunately, code of the form:
> 
>    ALTER TABLE x_segments ADD id INTEGER PRIMARY KEY;
> 
> is documented as not supported.
> http://www.sqlite.org/lang_altertable.html .  As far as I can tell,
> this means that there is no option to do a cheap schema upgrade to get
> the correct semantics.  Am I missing a trick?
> 

It appears that you can set

   PRAGMA writable_schema=ON;

Then do a manual UPDATE of the sqlite_master table to insert
an "id INTEGER PRIMARY KEY" into the SQL for the table definition.
I tried it and it seems to work.  But it is dangerous.  If you
mess up, you corrupt the database file.
--
D. Richard Hipp <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to