On Sep 8, 2016 8:16 AM, "Richard Hipp" <d...@sqlite.org> wrote: > > On 9/8/16, Stephen Chrzanowski <pontia...@gmail.com> wrote: > > > > However, the rabbit I was hoping to pull out of the hat was that the change > > in version numbers be done automatically when I make a change in the 3rd > > party DB management tool.
I don't know if this would work, but maybe one could add a trigger to sqlite_master that would automatically update the integer whenever something happens to literally change the schema. That way third party tools would keep the number up to date as well as your own custom code without needing a user defined function. > > Perhaps make your application schema-version number a hash of the SQL > for the schema, like this: > > SELECT md5sum(sql) FROM ( > SELECT sql FROM sqlite_master > WHERE sql IS NOT NULL > ORDER BY sql > ); > > You will need to add the md5sum() aggregate function yourself. A > sample implementation can be found in the SQLite source tree (used for > testing) here: https://www.sqlite.org/src/artifact/bdae822f2?ln=3894-3932 > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users