NOTE: This post is OBE. Check out the active record oracle adapter. Most/all changes have been added to it.
The active_record_oracle_extensions plugin provides support for adding foreign keys to migrations, adding synonyms to migrations, and disabling foreign key constraints during fixture loading. These are features that I needed in my applications, but either did not exist in other plugins, or the plugins seem to have been abandoned.
1
|
|
Adding Foreign Keys In a Migration
The example below shows a snippet from a migration that adds a foreign key.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Adding a Synonym in Migration
The example below shows the creation of a synonym named events for other_user.events. The force option adds “or replace” to the sql that generates the synonym. It is assumed that the user under which your are creating the synonym already has the needed grants to allow the creation of the synonym on other_user.
1
|
|
Disabling Constraints During Fixture Loading
If you are using sys or system as your user for your rails application, then do not use this plugin, or use it at your own risk. During fixture loading, this plugin disables constraints for the user that has established the connection to oracle, and then re-enables the constraints after the load.