Test db migration 31

Add some data into the db and make sure the alter table works.

Change-Id: I13df69198e3dcdc6f4ab562041bfadb890782328
Replace try...except...pass block with assertRaises

To make the test logic looks tidy and clean.

Change-Id: Id278524a8d4b8bf953f6c3d250e47be04c5edb55
Merge "Replace try...except...pass block with assertRaises"
Merge "Test db migration 31"