1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use crate::;
/// The owning side of a relationship. Stores the foreign key that references
/// another model's primary key.
///
/// A `BelongsTo` field does not store data in its own column; instead, its
/// [`ForeignKey`] contains one or more primitive fields on the same model
/// whose values match the target model's primary key.
///
/// # Examples
///
/// ```ignore
/// // Given a `Comment` model that belongs to a `Post`:
/// let belongs_to: &BelongsTo = comment_field.ty.as_belongs_to_unwrap();
/// let post_model = belongs_to.target(&schema);
/// ```