Commit b6d5357
authored
Remove not needed
Table `route_mappings` has a unique constraint for columns `app_guid`, `route_guid`, `process_type` and `app_port`.
Therefore we can rely on the DB to catch uniqueness errors and remove the sequel `validates_unique` in the model.
This reduces the number of DB queries as the following query is now skipped:
```SQL
SELECT 1 AS \"one\" FROM \"route_mappings\" WHERE ((\"app_guid\" = <app_guid>) AND (\"route_guid\" = <route_guid>) AND (\"process_type\" = 'web') AND (\"app_port\" = <port>)) LIMIT 1"
```validates_unique for route mappings (#4620)1 parent d7ae589 commit b6d5357
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
0 commit comments