Archive for the ‘General’ Category

Rake DB:Migrate Error due to Foreign Key

Saturday, May 10th, 2008

I had so many junk/test records in my Rails project and thought “hey… rake DB:migrate is a quick way to wipe those records.”

I ran ‘rake db:migrate VERSION=0′ and MySQL was not too happy with me.

Here is the error:

rake aborted!
Mysql::Error: Error on rename of ‘./<database name>/#sql-bb3b_3′ to ‘./<database name>/contexts’ (errno: 150): ALTER TABLE `contexts` DROP `user_id`

Again… Google is my best friend to find these kind of errors. :)
The problem is caused by database foreign key.

If your migration has the following line:

class MigrationName < ActiveRecord::Migration
def self.up
  .
  .
  execute “alter table <table name> add constraint <foreign key name> foreign key (<column name>) references …”
end

The solution is to drop the foreign key first before removing the column:

def self.down
  execute “alter table <table name> drop foreign key <foreign key name>”
  remove_column …
end

RSS Fatigue

Wednesday, February 27th, 2008

I think I have too many RSS feeds that I follow… :(
I have been cutting down the number of feeds, but it’s been difficult to do. Obviously, I still want to keep a few feeds about general news, business news, IT news, learning (self improvement, information architecture, web design), and (last but not least) tech news!
I think I have about 40 feeds that I follow everyday… I’m looking forward to cut them down even further. Again, it’s difficult to do so because I really enjoy following the news.

The good news is that I only skim through most of the feeds. :)

Web Design Book: Bulletproof Web Design

Saturday, December 8th, 2007

I recently purchased Bulletproof Web Design book and I like it!

I am still learning CSS and this book take my learning to a different level. There are some techniques in the book that I actually use already (ehm… sidebar).

I am a fan of fluid website design and Dan Cederholm (the book author) shows how it can be done.

I highly recommend the book!

Updated Sidebar

Friday, December 7th, 2007

I’ve updated the sidebar to be a bit nicer.

I’m planning of improving my theme a little bit at a time with various techniques that I observe and learn from other websites and books.

I’m beginning to enjoy web design now. :)

Another new Wordpress theme

Tuesday, October 9th, 2007

I switched to my new Wordpress theme.

Since it’s still under development, I call it a beta. :)
This new theme supports a highlight:

This is a post hightlight

Cool, eh? :)

Wordpress 2.1 Issue with Ecto

Saturday, February 3rd, 2007

I have been using Ecto to post my blog entries.

Unfortunately, upgrading to Wordpress 2.1 causes Ecto to stop downloading the entries to my computer.

As always, Google is your best friend. :)
I did a search on “wordpress 2.1 ecto” and got many entries.

The first entry shows how I can fix the problem (thank you, Erik!).

The issue can be fixed by downloading the xmlrpc.php file from http://trac.wordpress.org/attachment/ticket/3662/3662-xmlrpc-categoryId.diff (thank you, Lloyd!).

(more…)

Switching over to WordPress!

Sunday, November 19th, 2006

After reviewing various blog software, I finally decided to use WordPress.

I played around with Drupal and I found it too complicated to use for my simple tech blog.
Joomla is way to overwhelming too.