← Back to team overview

ubuntu-touch-coreapps team mailing list archive

Re: [RSS Reader] SQL code

 

Hi

Wouldn't this make it impossible to rename the tag without also 
renaming all entries in "feed_tag"? Say for instance if you want to 
rename your "My hobbies" tag to "Hobbies" at some point?


Cheers,
Svenn-Arne

On Thu 02 May 2013 06:30:42 PM CEST, Riccardo Padovani wrote:
> 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