mirror of
https://github.com/Phundrak/georm.git
synced 2025-12-13 16:31:51 +01:00
feat: add foreign one_to_one relationships
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
use georm::Georm;
|
||||
|
||||
#[derive(Debug, sqlx::FromRow, Georm, PartialEq, Eq, Default)]
|
||||
#[georm(table = "biographies")]
|
||||
#[georm(
|
||||
table = "biographies",
|
||||
one_to_one = [{
|
||||
name = "author", remote_id = "biography_id", table = "authors", entity = Author
|
||||
}]
|
||||
)]
|
||||
pub struct Biography {
|
||||
#[georm(id)]
|
||||
pub id: i32,
|
||||
|
||||
Reference in New Issue
Block a user