collab: Use new subscription usage tables (#29848)

This PR updates Collab to use the new subscription usage tables added in
#29847.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-03 13:56:43 -04:00 committed by GitHub
parent c1247977ed
commit c3d2831d86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -69,7 +69,7 @@ impl LlmDatabase {
Ok(
subscription_usage::Entity::insert(subscription_usage::ActiveModel {
id: ActiveValue::not_set(),
id: ActiveValue::set(Uuid::now_v7()),
user_id: ActiveValue::set(user_id),
period_start_at: ActiveValue::set(period_start_at),
period_end_at: ActiveValue::set(period_end_at),

View file

@ -4,10 +4,10 @@ use sea_orm::entity::prelude::*;
use time::PrimitiveDateTime;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "subscription_usages")]
#[sea_orm(table_name = "subscription_usages_v2")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub id: Uuid,
pub user_id: UserId,
pub period_start_at: PrimitiveDateTime,
pub period_end_at: PrimitiveDateTime,

View file

@ -4,10 +4,10 @@ use serde::Serialize;
use crate::llm::db::ModelId;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "subscription_usage_meters")]
#[sea_orm(table_name = "subscription_usage_meters_v2")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub id: Uuid,
pub subscription_usage_id: i32,
pub model_id: ModelId,
pub mode: CompletionMode,