Add BoundChannelId field to support binding a token to a specific channel.
When set, the token will always use the bound channel for requests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the new pricing models to both migrateDB() and migrateDBFast()
functions to enable automatic table creation on database initialization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous implementation only did INSERT without handling conflicts.
Now uses GORM's OnConflict clause to properly update existing records
when (model_name, channel_id) unique constraint is violated.
On conflict updates: quota_type, model_ratio, completion_ratio,
model_price, tag_ids, updated_time
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add new model to support per-channel pricing for models,
allowing the same model to have different prices across
different channels.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a channel is created or updated, automatically sync its models to the
models table if they don't exist. Models created this way are marked with
SyncOfficial=0 to prevent official sync from overwriting them.