I’m working on building a rails on top of
<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
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