This is going to be used to distribute tokens between Tunnelbroker instances in order to open socket connections.
In this solution, Tunnelbroker is going to query for:
- Token without instance assigned to it (new token or previous Tunnelbroker instance was gracefully shut down)
- Token where there is a heartbeat for some time interval, which means the previous instance that owned the token is dead.
For this purpose, we need two indexes on assignedInstance and lastHeartbeat to make it quicker and cheaper; we're going to query this a lot.
WE're using userID here, as this will be handy in Tunnelbroker, we need a relationship between DC's token and userID to be able to find user devices, and e.g., send notifs.
Ideally, instead of this mechanism with polling from Tunnelbroker, we should've used a stream, but this is a lot more work (things like setting up Lambda).
There is no need for migration to populate this table, as it hasn't been released yet (DCs tokens)
Depends on D15206