First step for a legacy db

what’s the first step for the migration of a legacy db such as:

mysql>
mysql> SHOW TABLES;
±------------------------+
| Tables_in_feed_on_feeds |
±------------------------+
| fof_feed |
| fof_item |
| fof_item_tag |
| fof_subscription |
| fof_tag |
| fof_user |
±------------------------+
6 rows in set (0.00 sec)

mysql>
mysql> DESCRIBE fof_feed;
±------------------------±--------±-----±----±--------
±---------------+
| Field | Type | Null | Key | Default |
Extra |
±------------------------±--------±-----±----±--------
±---------------+
| feed_id | int(11) | NO | PRI | NULL |
auto_increment |
| feed_url | text | NO | |
| |
| feed_title | text | NO | |
| |
| feed_link | text | NO | |
| |
| feed_description | text | NO | |
| |
| feed_image | text | YES | | NULL
| |
| feed_image_cache_date | int(11) | YES | | 0
| |
| feed_cache_date | int(11) | YES | | 0
| |
| feed_cache_attempt_date | int(11) | YES | | 0
| |
| feed_cache | text | YES | | NULL
| |
±------------------------±--------±-----±----±--------
±---------------+
10 rows in set (0.00 sec)

mysql>
mysql>

thanks,

Thufir

Thufir,

When you define your models and associations between them, you can
override the defaults that Rails uses. Rails adopts the Convention
over Configuration paradigm, but also includes all the configuration
hooks you’d need.

So, for example, the convention is that the primary key is a field
called “id” and is autogenerated. Instead, you’d tell the fof_feed
model to use “feed_id” as the id.

class FofFeed < ActiveRecord::Base

set_primary_key “feed_id”

end

# You still use the id method to access this value

f = FofFeed.create

f.id

If you look at the API docs for ActiveRecord::Base you’ll find these
configuration options.

That should get you started. :slight_smile:

-Danimal

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs