Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ axum-extra = "0.9.3"
tower-http = "0.5.2"
tower = "0.4.13"
hex = "0.4.3"
sea-orm = "0.12.15"
sea-orm = "1.0.0"
flate2 = "1.0.30"
bstr = "1.9.1"
colored = "2.1.0"
Expand Down
4 changes: 2 additions & 2 deletions ceres/src/lfs/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use chrono::{prelude::*, Duration};
use jupiter::storage::lfs_storage::LfsStorage;
use rand::prelude::*;

use callisto::{lfs_locks, lfs_objects, lfs_split_relation};
use callisto::{lfs_locks, lfs_objects, lfs_split_relations};
use common::errors::{GitLFSError, MegaError};

use crate::lfs::lfs_structs::{
Expand Down Expand Up @@ -763,7 +763,7 @@ async fn lfs_put_relation(
offset: i64,
size: i64,
) -> Result<(), GitLFSError> {
let relation = lfs_split_relation::Model {
let relation = lfs_split_relations::Model {
ori_oid: ori_oid.to_owned(),
sub_oid: sub_oid.to_owned(),
offset,
Expand Down
2 changes: 1 addition & 1 deletion docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,4 @@ erDiagram
- Generating entities:
Entities can be generated from the database table structure with the following command

`sea-orm-cli generate entity -u "postgres://postgres:$postgres@localhost/mega_re" -o jupiter/entity/src`
`sea-orm-cli generate entity -u "postgres://postgres:$postgres@localhost/mega" -o jupiter/entity/src`
46 changes: 22 additions & 24 deletions jupiter/callisto/src/db_enums.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
use core::fmt;
use std::fmt::Display;

use sea_orm::prelude::StringLen;
use sea_orm::{DeriveActiveEnum, EnumIter};

#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")]
#[sea_orm(
rs_type = "String",
db_type = "String(StringLen::None)",
rename_all = "snake_case"
)]
pub enum StorageType {
#[sea_orm(string_value = "database")]
Database,
#[sea_orm(string_value = "local_fs")]
LocalFs,
#[sea_orm(string_value = "remote_url")]
RemoteUrl,
}

Expand All @@ -24,15 +26,15 @@ impl fmt::Display for StorageType {
}
}


#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy)]
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")]
#[sea_orm(
rs_type = "String",
db_type = "String(StringLen::None)",
rename_all = "snake_case"
)]
pub enum MergeStatus {
#[sea_orm(string_value = "open")]
Open,
#[sea_orm(string_value = "merged")]
Merged,
#[sea_orm(string_value = "closed")]
Closed,
}

Expand All @@ -48,35 +50,31 @@ impl Display for MergeStatus {
}

#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")]
#[sea_orm(
rs_type = "String",
db_type = "String(StringLen::None)",
rename_all = "snake_case"
)]
pub enum RefType {
#[sea_orm(string_value = "branch")]
Branch,
#[sea_orm(string_value = "tag")]
Tag,
}


#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")]
#[sea_orm(
rs_type = "String",
db_type = "String(StringLen::None)",
rename_all = "snake_case"
)]
pub enum ConvType {
#[sea_orm(string_value = "comment")]
Comment,
#[sea_orm(string_value = "deploy")]
Deploy,
#[sea_orm(string_value = "commit")]
Commit,
#[sea_orm(string_value = "forse_push")]
ForcePush,
#[sea_orm(string_value = "edit")]
Edit,
#[sea_orm(string_value = "review")]
Edit,
Review,
#[sea_orm(string_value = "approve")]
Approve,
#[sea_orm(string_value = "merge_queue")]
MergeQueue,
#[sea_orm(string_value = "merged")]
Merged,
}

Expand Down
6 changes: 3 additions & 3 deletions jupiter/callisto/src/git_blob.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -9,9 +9,9 @@ pub struct Model {
pub id: i64,
pub repo_id: i64,
pub blob_id: String,
pub commit_id: String,
pub name: String,
pub name: Option<String>,
pub size: i32,
pub commit_id: String,
pub created_at: DateTime,
}

Expand Down
5 changes: 2 additions & 3 deletions jupiter/callisto/src/git_commit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;
use serde_json::Value;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "git_commit")]
Expand All @@ -11,7 +10,7 @@ pub struct Model {
pub repo_id: i64,
pub commit_id: String,
pub tree: String,
pub parents_id: Value,
pub parents_id: Json,
#[sea_orm(column_type = "Text", nullable)]
pub author: Option<String>,
#[sea_orm(column_type = "Text", nullable)]
Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/git_issue.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/git_pr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/git_repo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/git_tag.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
3 changes: 2 additions & 1 deletion jupiter/callisto/src/git_tree.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -9,6 +9,7 @@ pub struct Model {
pub id: i64,
pub repo_id: i64,
pub tree_id: String,
#[sea_orm(column_type = "VarBinary(StringLen::None)")]
pub sub_trees: Vec<u8>,
pub size: i32,
pub commit_id: String,
Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/import_refs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/lfs_locks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/lfs_objects.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
Expand All @@ -15,4 +17,4 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
impl ActiveModelBehavior for ActiveModel {}
4 changes: 2 additions & 2 deletions jupiter/callisto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

pub mod prelude;

Expand All @@ -13,7 +13,7 @@ pub mod git_tree;
pub mod import_refs;
pub mod lfs_locks;
pub mod lfs_objects;
pub mod lfs_split_relation;
pub mod lfs_split_relations;
pub mod mega_blob;
pub mod mega_commit;
pub mod mega_issue;
Expand Down
4 changes: 2 additions & 2 deletions jupiter/callisto/src/mega_blob.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -7,9 +7,9 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: i64,
#[sea_orm(unique)]
pub blob_id: String,
pub commit_id: String,
#[sea_orm(column_type = "Text")]
pub name: String,
pub size: i32,
pub created_at: DateTime,
Expand Down
5 changes: 2 additions & 3 deletions jupiter/callisto/src/mega_commit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;
use serde_json::Value;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "mega_commit")]
Expand All @@ -11,7 +10,7 @@ pub struct Model {
#[sea_orm(unique)]
pub commit_id: String,
pub tree: String,
pub parents_id: Value,
pub parents_id: Json,
#[sea_orm(column_type = "Text", nullable)]
pub author: Option<String>,
#[sea_orm(column_type = "Text", nullable)]
Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mega_issue.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mega_mr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
4 changes: 2 additions & 2 deletions jupiter/callisto/src/mega_mr_comment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -8,7 +8,7 @@ pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: i64,
pub conv_id: i64,
#[sea_orm(column_type = "Text")]
#[sea_orm(column_type = "Text", nullable)]
pub comment: Option<String>,
pub edited: bool,
}
Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mega_mr_conv.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
5 changes: 2 additions & 3 deletions jupiter/callisto/src/mega_refs.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;


#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "mega_refs")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: i64,
#[sea_orm(column_type = "Text")]
#[sea_orm(column_type = "Text", unique)]
pub path: String,
pub ref_commit_hash: String,
pub ref_tree_hash: String,
Expand Down
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mega_tag.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand Down
3 changes: 2 additions & 1 deletion jupiter/callisto/src/mega_tree.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -8,6 +8,7 @@ pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: i64,
pub tree_id: String,
#[sea_orm(column_type = "VarBinary(StringLen::None)")]
pub sub_trees: Vec<u8>,
pub size: i32,
pub commit_id: String,
Expand Down
9 changes: 6 additions & 3 deletions jupiter/callisto/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

pub use crate::git_blob::Entity as GitBlob;
pub use crate::git_commit::Entity as GitCommit;
Expand All @@ -7,9 +7,10 @@ pub use crate::git_pr::Entity as GitPr;
pub use crate::git_repo::Entity as GitRepo;
pub use crate::git_tag::Entity as GitTag;
pub use crate::git_tree::Entity as GitTree;
pub use crate::import_refs::Entity as GitRefs;
pub use crate::import_refs::Entity as ImportRefs;
pub use crate::lfs_locks::Entity as LfsLocks;
pub use crate::lfs_objects::Entity as LfsObjects;
pub use crate::lfs_split_relations::Entity as LfsSplitRelations;
pub use crate::mega_blob::Entity as MegaBlob;
pub use crate::mega_commit::Entity as MegaCommit;
pub use crate::mega_issue::Entity as MegaIssue;
Expand All @@ -19,4 +20,6 @@ pub use crate::mega_mr_conv::Entity as MegaMrConv;
pub use crate::mega_refs::Entity as MegaRefs;
pub use crate::mega_tag::Entity as MegaTag;
pub use crate::mega_tree::Entity as MegaTree;
pub use crate::raw_blob::Entity as RawObjects;
pub use crate::raw_blob::Entity as RawBlob;
pub use crate::ztm_node::Entity as ZtmNode;
pub use crate::ztm_repo_info::Entity as ZtmRepoInfo;
6 changes: 3 additions & 3 deletions jupiter/callisto/src/raw_blob.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;

Expand All @@ -11,11 +11,11 @@ pub struct Model {
pub id: i64,
#[sea_orm(unique)]
pub sha1: String,
#[sea_orm(column_type = "Text")]
#[sea_orm(column_type = "Text", nullable)]
pub content: Option<String>,
pub file_type: Option<String>,
pub storage_type: StorageType,
#[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)]
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub data: Option<Vec<u8>>,
#[sea_orm(column_type = "Text", nullable)]
pub local_path: Option<String>,
Expand Down
Loading