On Thu, May 2, 2013 at 4:40 PM, Joey Chan <[email protected]> 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 <[email protected]>

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps
More help   : https://help.launchpad.net/ListHelp

Reply via email to