# Rss aggregator schema

**URL:** <https://www.ruby-forum.com/t/rss-aggregator-schema/121396>\
**Category:** Rails\
**Created:** [November 27, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/rss-aggregator-schema/121396 "2007-11-27T16:38:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 27, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/rss-aggregator-schema/121396/1 "2007-11-27T16:38:11Z")

</div>

I’m working on building a rails on top of  
\<[http://www.gnome.org/projects/](http://www.gnome.org/projects/)  
straw/\>. Currently I’m using MySQL while straw uses sqlite, so I’ll  
have  
to change to sqlite down the road.

Here’s my schema:

mysql\>  
mysql\> show tables from straw\_development;  
±----------------------------+  
| Tables\_in\_straw\_development |  
±----------------------------+  
| categories |  
| feeds |  
| schema\_info |  
±----------------------------+  
3 rows in set (0.00 sec)

mysql\>  
mysql\> describe straw\_development.categories;  
±------------±-------------±-----±----±--------±---------------+  
| Field | Type | Null | Key | Default | Extra |  
±------------±-------------±-----±----±--------±---------------+  
| id | int(11) | NO | PRI | NULL | auto\_increment |  
| title | varchar(255) | YES | | NULL | |  
| parent\_id | int(11) | YES | | NULL | |  
| category\_id | int(11) | YES | | NULL | |  
±------------±-------------±-----±----±--------±---------------+  
4 rows in set (0.00 sec)

mysql\>  
mysql\> describe straw\_development.feeds;  
±------------±-------------±-----±----±--------±---------------+  
| Field | Type | Null | Key | Default | Extra |  
±------------±-------------±-----±----±--------±---------------+  
| id | int(11) | NO | PRI | NULL | auto\_increment |  
| title | varchar(255) | YES | | NULL | |  
| location | varchar(255) | YES | | NULL | |  
| category\_id | int(11) | YES | | NULL | |  
±------------±-------------±-----±----±--------±---------------+  
4 rows in set (0.00 sec)

mysql\>  
mysql\>

and here’s the current code which straw is using:

1 CREATE TABLE IF NOT EXISTS feeds (

2 id INTEGER PRIMARY KEY,

3 title TEXT,

4 location VARCHAR(255),

5 category\_id INTEGER

6 );

7 –

8 CREATE TABLE IF NOT EXISTS items (

9 id INTEGER PRIMARY KEY,

10 title TEXT NOT NULL,

11 feed\_id INTEGER NOT NULL,

12 is\_read INTEGER NOT NULL DEFAULT 0,

13 link TEXT,

14 pub\_date TIMESTAMP NOT NULL,

15 description TEXT NOT NULL

16 );

17 –

18 CREATE TABLE IF NOT EXISTS categories (

19 id INTEGER PRIMARY KEY,

20 parent\_id INTEGER,

21 title TEXT

22 );

23 –

24 CREATE TABLE IF NOT EXISTS treeview\_nodes (

25 id INTEGER PRIMARY KEY,

26 obj\_id INTEGER NOT NULL,

27 norder INTEGER NOT NULL,

28 type VARCHAR(1) NOT NULL

29 );

30 –

31 INSERT INTO categories (parent\_id, title) VALUES (NULL, ‘root’);

[http://repo.or.cz/w/straw/fork.git?a=blob;f=data/sql/create\_01.sql](http://repo.or.cz/w/straw/fork.git?a=blob;f=data/sql/create_01.sql)

For my purposes, I only need to match the Feeds and Categories. Is this  
possible/easy from my end? Seems to me that the schema for straw would  
have to bend to ruby a bit?

thanks,

Thufir
