(&self, key: &ForeignKey, _table_name: &str, action: &TableAction)
| 324 | } |
| 325 | |
| 326 | fn foreign_key(&self, key: &ForeignKey, _table_name: &str, action: &TableAction) -> String { |
| 327 | let update = if key.on_update { |
| 328 | "on update cascade" |
| 329 | } else { |
| 330 | "" |
| 331 | }; |
| 332 | |
| 333 | let delete = if key.on_delete { |
| 334 | "on delete cascade" |
| 335 | } else { |
| 336 | "" |
| 337 | }; |
| 338 | |
| 339 | if *action == TableAction::Alter { |
| 340 | "-- SQLite does not support add foreign key on alter \n".to_string() |
| 341 | }else{ |
| 342 | format!( |
| 343 | "FOREIGN KEY(\"{}\") REFERENCES \"{}\"(\"{}\") {} {} ", |
| 344 | key.column_name, key.foreign_table, key.referenced_column, update, delete |
| 345 | ) |
| 346 | } |
| 347 | |
| 348 | } |
| 349 | fn drop_column(&self, column_name: &str) -> String { |
| 350 | format!( |
| 351 | "-- SQLite does not support DROP COLUMN directly: `{}`", |
nothing calls this directly
no outgoing calls
no test coverage detected