Fixed tests

This commit is contained in:
iko 2023-02-13 09:41:11 +03:00
parent f652947d27
commit cc4f96de25
4 changed files with 14 additions and 0 deletions

View File

@ -30,7 +30,10 @@ pub struct ForeignKey {
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
pub enum OnDelete { pub enum OnDelete {
#[serde(rename = "restrict")]
Restrict, Restrict,
#[serde(rename = "cascade")]
Cascade, Cascade,
} }
@ -45,7 +48,10 @@ impl OnDelete {
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
pub enum OnUpdate { pub enum OnUpdate {
#[serde(rename = "restrict")]
Restrict, Restrict,
#[serde(rename = "cascade")]
Cascade, Cascade,
} }

View File

@ -45,6 +45,8 @@ fn add_foreign_key() {
columns = ["user_id"] columns = ["user_id"]
referenced_table = "users" referenced_table = "users"
referenced_columns = ["id"] referenced_columns = ["id"]
on_delete = "cascade"
on_update = "cascade"
"#, "#,
); );
@ -152,6 +154,8 @@ fn add_invalid_foreign_key() {
columns = ["user_id"] columns = ["user_id"]
referenced_table = "users" referenced_table = "users"
referenced_columns = ["id"] referenced_columns = ["id"]
on_update = "cascade"
on_delete = "cascade"
"#, "#,
); );

View File

@ -156,6 +156,8 @@ fn create_table_with_foreign_keys() {
columns = ["user_id"] columns = ["user_id"]
referenced_table = "users" referenced_table = "users"
referenced_columns = ["id"] referenced_columns = ["id"]
on_update = "cascade"
on_delete = "cascade"
"#, "#,
); );

View File

@ -35,6 +35,8 @@ fn remove_foreign_key() {
columns = ["user_id"] columns = ["user_id"]
referenced_table = "users" referenced_table = "users"
referenced_columns = ["id"] referenced_columns = ["id"]
on_delete = "cascade"
on_update = "cascade"
"#, "#,
); );