chore: checkpoint ai search comments and i18n foundation
This commit is contained in:
33
backend/migration/src/m20260328_000007_create_ai_chunks.rs
Normal file
33
backend/migration/src/m20260328_000007_create_ai_chunks.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use loco_rs::schema::*;
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
pub struct Migration;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
create_table(
|
||||
manager,
|
||||
"ai_chunks",
|
||||
&[
|
||||
("id", ColType::PkAuto),
|
||||
("source_slug", ColType::String),
|
||||
("source_title", ColType::StringNull),
|
||||
("source_path", ColType::StringNull),
|
||||
("source_type", ColType::String),
|
||||
("chunk_index", ColType::Integer),
|
||||
("content", ColType::Text),
|
||||
("content_preview", ColType::StringNull),
|
||||
("embedding", ColType::JsonBinaryNull),
|
||||
("word_count", ColType::IntegerNull),
|
||||
],
|
||||
&[],
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
drop_table(manager, "ai_chunks").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user