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
#[cfg(feature = "with-serde")]
use serde::{Deserialize, Serialize};
use crate as sea_schema;
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct ForeignKeyInfo {
pub name: String,
pub columns: Vec<String>,
pub referenced_table: String,
pub referenced_columns: Vec<String>,
pub on_update: ForeignKeyAction,
pub on_delete: ForeignKeyAction,
}
#[derive(Clone, Debug, PartialEq, sea_schema_derive::Name)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub enum ForeignKeyAction {
#[name = "CASCADE"]
Cascade,
#[name = "SET NULL"]
SetNull,
#[name = "SET DEFAULT"]
SetDefault,
#[name = "RESTRICT"]
Restrict,
#[name = "NO ACTION"]
NoAction,
}