Sqlite compatibility

SQLite (used by Wikimedia Jenkins) does not let one create an index
inside the CREATE TABLE statement. Decouple them.

Bug: 65875
Change-Id: Ifdcd594b3e31e08466983166135f047f997f562e
(cherry picked from commit be96a311359e1c5da506d9d2eb34eb210ee3aee5)