migrate tables: stars, reactions, follows, public_keys
Two major changes:
- Remove autoincrement id for these tables.
AUTOINCREMENT primary key does not help much for these tables and only
introduces slice performance overhead. Use default rowid with
non-autoincrement integer instead.
- Remove unique constraints other than
(did, rkey)
We cannot block users creating non-unique atproto records. Appview needs to handle those properly. For example, if user unstar a repo, appview should delete all existing star records pointing to that repo.
To allow this, remove all constraints other than (did, rkey).
Minor changes done while migrating tables:
- rename
thread_atinreactionstosubject_atto match with other tables - follow common column names like
didandcreated - allow self-follow (similar reason to 2nd major change. we should block it from service layer instead)
Signed-off-by: Seongmin Lee git@boltless.me