[keyserver] add migration to create policy_acknowledgments table
Summary:
Add the table to track user acknowledgments.
Table structure was described in ENG-1868.
Table using only primary key with two columns - (user, policy) and user is in first place on purpose.
A lot of queries will be performed on this table based on the user id. InnoDB by default will use BTREE as indexing algorithm which works fine for this approach (keep rows sorted based on user ID and should be decent).
I also did a test with added additional index only for user column a perform some queries on table with ~900 rows and ~400 users, measured times were almost equal on both approaches so I think there is no need for another index (might waster some resources) and primary key with pair (user, policy) should be sufficient.
Test Plan:
- Restart the keyserver
- Check in metadata table if the database version was incremented.
- Check if policy_acknowledgments was created with proper structure, screenshot with table:
Reviewers: atul, marcin, ashoat, tomek
Reviewed By: atul, marcin, ashoat, tomek
Subscribers: tomek, ashoat, atul, abosh
Differential Revision: https://phab.comm.dev/D5307