Thank you :-)

On Tue, Sep 30, 2014 at 3:44 PM, Simon Slavin <[email protected]> wrote:

>
> On 30 Sep 2014, at 12:32pm, dd <[email protected]> wrote:
>
> > My db already there in production. I have to do it programmatically.
> >
> > Can it be done with any sqlite apis/pragmas.
>
> Sure.  But you do need to drop the table at one point so nothing should be
> trying to use it.
>
> Depending on how your indexes, triggers and foreign keys are defined you
> can do something like
>
> CREATE TABLE newVersion (<put in correct table definition with collations
> here>)
> INSERT INTO newVersion SELECT * FROM originalName
> DROP originalName
> ALTER TABLE newVersion RENAME TO originalName
>
> You may then have to recreate any indexes triggers and foreign keys.
>
> Again, don't forget to take a backup before messing with anything.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to