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
4 changes: 2 additions & 2 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ db_type = "postgres"
db_path = "${base_dir}/mega.db"

# database connection url, set to "postgres://mono:mono@mono-pg:5432/mono" if you're using docker
db_url = "postgres://mono:mono@localhost:5432/mono"
#db_url = "postgres://mono:mono@127.0.0.1:5432/mono"
#db_url = "postgres://mono:mono@localhost:5432/mono"
db_url = "postgres://mono:mono@127.0.0.1:5432/mono"

# db max connection, setting it to twice the number of CPU cores would be appropriate.
max_connection = 16
Expand Down
10 changes: 9 additions & 1 deletion jupiter/callisto/src/gpg_key.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.14

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

Expand All @@ -7,7 +9,7 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub user_id: i64,
#[sea_orm(column_type = "Text", unique)]
#[sea_orm(column_type = "Text")]
pub key_id: String,
#[sea_orm(column_type = "Text")]
pub public_key: String,
Expand All @@ -31,4 +33,10 @@ pub enum Relation {
User,
}

impl Related<super::user::Entity> for Entity {
fn to() -> RelationDef {
Relation::User.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.14

pub mod entity_ext;
pub mod prelude;

pub mod access_token;
Expand Down Expand Up @@ -44,3 +43,4 @@ pub mod sea_orm_active_enums;
pub mod ssh_keys;
pub mod user;
pub mod vault;
pub mod entity_ext;
1 change: 1 addition & 0 deletions jupiter/callisto/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub use super::git_pr::Entity as GitPr;
pub use super::git_repo::Entity as GitRepo;
pub use super::git_tag::Entity as GitTag;
pub use super::git_tree::Entity as GitTree;
pub use super::gpg_key::Entity as GpgKey;
pub use super::import_refs::Entity as ImportRefs;
pub use super::item_assignees::Entity as ItemAssignees;
pub use super::item_labels::Entity as ItemLabels;
Expand Down
11 changes: 10 additions & 1 deletion jupiter/callisto/src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
pub enum Relation {
#[sea_orm(has_many = "super::gpg_key::Entity")]
GpgKey,
}

impl Related<super::gpg_key::Entity> for Entity {
fn to() -> RelationDef {
Relation::GpgKey.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
3 changes: 2 additions & 1 deletion jupiter/src/migration/m20250820_102133_gpgkey.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use sea_orm_migration::{prelude::*, schema::*};
use crate::migration::pk_bigint;

#[derive(DeriveMigrationName)]
pub struct Migration;
Expand All @@ -12,7 +13,7 @@ impl MigrationTrait for Migration {
Table::create()
.table(GpgKey::Table)
.if_not_exists()
.col(pk_auto(GpgKey::Id))
.col(pk_bigint(GpgKey::Id))
.col(big_integer(GpgKey::UserId))
.col(text(GpgKey::KeyId))
.col(text(GpgKey::PublicKey))
Expand Down
Loading