Commit bb446f2
Address review of enforced: option implementation
- change_foreign_key now raises ArgumentError when :enforced is omitted,
matching rails/rails#57377's PG behavior. Without the guard, the bare
call `change_foreign_key :foo, :bar` would silently emit `... DISABLE`
via the `enforced ? 'ENABLE' : 'DISABLE'` ternary on nil.
- Docstring on change_foreign_key documents the accepted opts (:enforced
plus identifying keys) and the side effect that bare DISABLE/ENABLE
also flip VALIDATED — surfaced previously only in the commit message.
- visit_ForeignKeyDefinition uses o.enforced? (the predicate added on
ForeignKeyDefinition by rails/rails#57377) for parity with !o.validate?
on the next line.
- New specs:
- change_foreign_key without :enforced raises ArgumentError
- change_foreign_key identified by name: form
- add_reference foreign_key: { enforced: false, validate: false }
- inline t.foreign_key inside create_table
- enforced: false + deferrable: :deferred round-trip
- completeness assertion (key?(:validate) == false) on the "enables a
DISABLEd FK" spec, confirming ENABLE VALIDATE state after bare ENABLE
- Trim duplicative spec comments per the project's terse-comments norm.
To be squashed into 748a42a once CI is green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 748a42a commit bb446f2
4 files changed
Lines changed: 66 additions & 12 deletions
File tree
- lib/active_record/connection_adapters/oracle_enhanced
- spec/active_record/connection_adapters/oracle_enhanced
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
826 | 831 | | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
827 | 835 | | |
828 | 836 | | |
829 | 837 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
| |||
Lines changed: 56 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1951 | 1951 | | |
1952 | 1952 | | |
1953 | 1953 | | |
1954 | | - | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | 1954 | | |
1959 | 1955 | | |
1960 | 1956 | | |
1961 | 1957 | | |
1962 | 1958 | | |
1963 | 1959 | | |
1964 | 1960 | | |
1965 | | - | |
1966 | | - | |
1967 | 1961 | | |
1968 | 1962 | | |
1969 | 1963 | | |
| |||
1997 | 1991 | | |
1998 | 1992 | | |
1999 | 1993 | | |
| 1994 | + | |
2000 | 1995 | | |
2001 | 1996 | | |
2002 | 1997 | | |
| |||
2009 | 2004 | | |
2010 | 2005 | | |
2011 | 2006 | | |
2012 | | - | |
2013 | | - | |
2014 | 2007 | | |
2015 | 2008 | | |
2016 | 2009 | | |
2017 | 2010 | | |
2018 | 2011 | | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
2019 | 2067 | | |
2020 | 2068 | | |
2021 | 2069 | | |
| |||
0 commit comments