Get collab2 green
This commit is contained in:
parent
c529343ba1
commit
e1525e2b47
265 changed files with 64477 additions and 40 deletions
31
crates/collab2/src/db/tables/buffer_snapshot.rs
Normal file
31
crates/collab2/src/db/tables/buffer_snapshot.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
use crate::db::BufferId;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "buffer_snapshots")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub buffer_id: BufferId,
|
||||
#[sea_orm(primary_key)]
|
||||
pub epoch: i32,
|
||||
pub text: String,
|
||||
pub operation_serialization_version: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::buffer::Entity",
|
||||
from = "Column::BufferId",
|
||||
to = "super::buffer::Column::Id"
|
||||
)]
|
||||
Buffer,
|
||||
}
|
||||
|
||||
impl Related<super::buffer::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Buffer.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
Loading…
Add table
Add a link
Reference in a new issue