Sporkmonger

purveyor of fabulously ambiguous eating utensils

Schema Fiddling

Posted by sporkmonger
Written February 16th, 2006

I’ve been fiddlin’ with the schema again. The default cache table is now cached_feeds and the url field has been renamed to href. These changes are being made in anticipation of the API changes I’ll be making for 0.3.0 and also because it’s driving me nuts to keep having to “monkey patch” my own code every time I want to use any of the nifty new stuff that I haven’t released yet.

Sorry for the inconvenience.

This change has been checked into Subversion. 0.2.23 should be out soon, and, thus far, seems to be a whole lot more stable than 0.2.22 was.

Update: By popular request, from uh… me, myself, and I, a migration file for this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

class UpdateFeedToolsSchema < ActiveRecord::Migration
  def self.up
    puts "Updating feed caches table..."
    rename_table(:feeds, :cached_feeds)
    rename_column(:cached_feeds, :url, :href)
  end

  def self.down
    puts "Restoring feed caches table..."
    rename_column(:cached_feeds, :href, :url)
    rename_table(:cached_feeds, :feeds)
  end
end
  1. Written February 16th, 2006 at 11:34 PM

    Does this mean there will not be a table named feeds? I have another table in my database named feeds and this was posing some problems.

  2. Written February 16th, 2006 at 11:45 PM

    That is correct, and that is exactly why the change was made.

  3. Written February 17th, 2006 at 09:55 AM

    Right on!

    I appreciate the great package and look forward to the next release.

  4. Ross Ross :
    Written February 17th, 2006 at 08:49 PM

    Heh, I was using “feed_cache”. I guess it’s worth it to switch the name around and use the default.

  5. Written February 18th, 2006 at 12:02 AM

    Well, it doesn’t really matter what you name the table. But it does matter that you rename the url field to href. But eh, if you’re going to do one, might as well do the other I suppose.

Leave a Response

NOTE: I'm afraid Javascript needs to be on in order to comment.

Comments should be formatted using Textile.

Ruby code should be enclosed within a <macro:code lang="ruby"> element. Other languages are supported. For output you can simply omit the lang attribute.