Fix SQLite buffer setup, fix PostgreSQL migration 274/head
authorShane Synan <digitalcircuit36939@gmail.com>
Sat, 4 Mar 2017 22:15:13 +0000 (16:15 -0600)
committerShane Synan <digitalcircuit36939@gmail.com>
Sun, 5 Mar 2017 05:19:07 +0000 (23:19 -0600)
commitc241487cfb37653b432e44d1b5a195bee7945675
treedfed7ce573bb1de0da75c83ea784a82f2d2fe232
parentcbc57790069f3bc3e54c59e54cd3274abff536e6
Fix SQLite buffer setup, fix PostgreSQL migration

Remove the ALTER TABLE command, this isn't needed during setup as the
buffer's getting created for the first time.

Add the CHECK constraint as seen in the upgrade script, limiting the
value of lastseenmsgid.

Add handling for lastmsgid when migrating from SQLite to PostgreSQL.

Fix 'SELECT populate_lastmsgid()' call by first resetting the query.

This fixes breakages caused by incomplete work in pull request #273.
src/core/SQL/PostgreSQL/20/migrate_write_buffer.sql
src/core/SQL/SQLite/21/migrate_read_buffer.sql
src/core/SQL/SQLite/21/setup_030_buffer.sql
src/core/abstractsqlstorage.h
src/core/postgresqlstorage.cpp
src/core/sqlitestorage.cpp