Commit 044ca74
Allow unmanaged autogenerated sequence names
To still support primary keys through db triggers, without adding back in
support for generating and maintaining them with migrations, add an
configuration boolen:
unmanaged_autogenerated_sequences = false # default
Which can be used in an initializer file. When set to `true` there will not be
an exception raised when the sequence name is defined in the model with the
previously supported value:
self.sequence_name = :autogenerated
This option allows for dbs managed outside of the application to use triggers
for primary keys. Without the `autogenerated` option an error is raised when
inserting the record:
ORA-02289: sequence does not exist1 parent 3eb404e commit 044ca74
File tree
1 file changed
+12
-0
lines changed- lib/active_record/connection_adapters
1 file changed
+12
-0
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
215 | 226 | | |
216 | 227 | | |
217 | 228 | | |
| |||
493 | 504 | | |
494 | 505 | | |
495 | 506 | | |
| 507 | + | |
496 | 508 | | |
497 | 509 | | |
498 | 510 | | |
| |||
0 commit comments