ubuntu-touch-coreapps team mailing list archive
-
ubuntu-touch-coreapps team
-
Mailing list archive
-
Message #00337
Re: [RSS Reader] SQL code
On Thu, May 2, 2013 at 4:40 PM, Joey Chan <qqworini@xxxxxxxxx> wrote:
> Hi Ladies and Gentlemen,
Hi :)
> SQL code is generated from the physical diagram, pls check below:
>
> [snip]
>
> 4. table tag: store data of tag;
Why in table tag there is an ID and the name can be NULL?
In my opinion is better to modify the tag's table in this way:
CREATE TABLE tag (
name VARCHAR(99) NOT NULL PRIMARY KEY
);
This because two tags can't have the same name, and a tag can't have
NULL as name.
Accordingly to this, feed_tag has to be:
CREATE TABLE feed_tag (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
feed_id INTEGER NULL,
tag_name VARCHAR(99) NULL,
FOREIGN KEY(feed_id) REFERENCES feed(id) on delete cascade
);
What do you think of what I said?
--
Riccardo Padovani <rpadovani@xxxxxxxxxxxxx>
Follow ups
References