<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Late to the Party: Oracle patches for Rails</title>
    <link>http://cwilliams.textdriven.com/articles/2005/07/25/oracle-patches-for-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruby. Rails. Stuff.</description>
    <item>
      <title>Oracle patches for Rails</title>
      <description>&lt;p&gt;The code I described and provided earlier in my entry: &lt;a href="http://cwilliams.textdriven.com/articles/2005/06/30/rails-db_structure_dump-and-oracle"&gt;Rails, db_structure_dump, and Oracle&lt;/a&gt;&amp;nbsp;was submitted as a patch to Rails around the time of the 0.13.0 release. I just received an email today closing the ticket, showing that the patch was closed in favor of ticket #1798. Curious, I poked around looking at ticket 1798. It includes a number or oracle related patches for Rails, including my implementation of structure_dump.&lt;/p&gt;
&lt;p&gt;The patches will give the Oracle adapter a number of improvements. Improvements related to the structure_dump implementation&amp;nbsp;are the implementation of&amp;nbsp;purging and cloning Oracle databases. Some bigger changes include the ability to use synonyms and a change which could break existing users: Using sequences on a per-table basis. Previously, Rails used a single sequence to generate the primary keys for all tables. The next release will change the behavior to create and use sequences in the form &lt;code&gt;&amp;ldquo;#{table_name}_seq&amp;rdquo;&lt;/code&gt; which is more common practice.&lt;/p&gt;
&lt;p&gt;The current stance is that existing Oracle users who want to retain the single, global sequence will&amp;nbsp;have to modify their environment.rb (after the next Rails release) to include:&lt;/p&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;notextile&gt;&lt;span class="constant"&gt;ActiveRecord&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;Base&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;set_sequence_name&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;rails_sequence&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;/notextile&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; As of Rails 1.0 RC3, the way to set the sequence name for all ActiveRecord's has changed from the initial proposal. Now, you'd do something like so:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;notextile&gt;&lt;span class="comment"&gt;# Post 0.13.1, Force the OCI Adapter to use the global sequence like it used to&lt;/span&gt;
&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;ActiveRecord::Base&lt;/span&gt;
  &lt;span class="ident"&gt;set_sequence_name&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;rails_sequence&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/notextile&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 25 Jul 2005 19:58:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:57f8034621ab44a96dbaff52696798e1</guid>
      <author>cwilliams</author>
      <link>http://cwilliams.textdriven.com/articles/2005/07/25/oracle-patches-for-rails</link>
      <category>Programming</category>
      <category>Ruby</category>
      <category>Rails</category>
      <category>oracle</category>
      <category>ruby</category>
      <category>Rails</category>
      <category>patch</category>
      <category>1.0</category>
    </item>
    <item>
      <title>"Oracle patches for Rails" by CG</title>
      <description>Hi,
Nice blog. I was looking around for anybody in Rochester working with Ruby on Rails as I have started to look into it for a month now and really love it. I currently program in PowerBuilder, informix, and had done about a year of Java in my previous job. Hope to be in touch and maybe exchange ideas, clear doubts on RoR. You can reach me at &lt;a href="mailto:chandrakant_g@yahoo.com"&gt;chandrakant_g@yahoo.com&lt;/a&gt;
Take care,
CG </description>
      <pubDate>Tue, 26 Jul 2005 18:00:53 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0a8c57554ad7369c69800ce36dec6cf0</guid>
      <link>http://cwilliams.textdriven.com/articles/2005/07/25/oracle-patches-for-rails#comment-65</link>
    </item>
  </channel>
</rss>
