When the legacy AdminUser (id="admin", a string) is logged in and tries
to create an API key, the string id was being passed to the Integer FK
column created_by_id on ApiKey, causing a DB type mismatch error. Resolve
the id by looking up the first AdminAccount row instead. Also adds a
try/except with session rollback around the DB write so failures surface
as a flash message rather than a 500.
- Updated `InvitationCreateRequest` model to change `server_ids` from required to optional with improved description.
- Enhanced `library_model` to include `external_id`, `server_name`, and `enabled` fields.
- Modified `InvitationFlowManager` to prioritize new many-to-many relationship checks for invitations.
- Created a new migration file to merge branches related to API key and foreign key improvements.
- Added comprehensive tests for API endpoints, including status, users, invitations, libraries, servers, and API key management.
- Implemented error handling tests for malformed JSON and inactive API keys.