Skip to content

Instantly share code, notes, and snippets.

@chixq
Last active January 3, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chixq/8516037 to your computer and use it in GitHub Desktop.
Save chixq/8516037 to your computer and use it in GitHub Desktop.
Program Table:
id;
name;
a.k.a;
description;
director; Foriegn key of id in Director Table
country;
actor;
catagory; Catagory is much more simple than tags. Some third party lib can handle this column (BLOB Type)
watch_url;
finished; |
season_total; |
current_season; | Can create some procedures to reduce the business logic work.
episode_tatal; |
current_episode; |
Program Season Indexing Table:
program_id; Foreign key of id in Program;
season_id; => hash(program_id, season_num); Primary key;
season_desc;
season_url;
season_whatever;
Director Table:
id;
name;
a.k.a;
description;
imdb_url;
Actor Table:
id;
name;
a.k.a;
description;
imdb_url;
Catagory Table:
id;
name;
EpisodeURL Table:
id; |
url; | make them two as the primary, not only id.
..
1. id as primary key expect for mentioned above.
2. Owing to the M2M relationship between Program Table and actor Table (catagory & url also), we have to design the M to M index table.
Program Actor Indexing Table:
program_id; Foriegn key with Program Table id
actor_id; Foriegn key with Actor Table id
Program Catagory Indexing Table;
..
..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment