mirror of
https://github.com/ilyakooo0/reshape.git
synced 2024-11-22 17:26:33 +03:00
Fixed tests
This commit is contained in:
parent
f652947d27
commit
cc4f96de25
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -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"
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -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"
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user