Internet Application Dev Lectures   <- IAD Lectures   <-  Sean Forman   <-  You Are Here

  


Types of Content

Store them Separate or Together

A Simple Data Model

Approval with views

Comments

create table comments_on_articles_raw (
	comment_id		integer primary key,
	-- on what article is this a comment?
	refers_to		not null references articles,
	creation_user		not null references users,
	creation_date		not null date,
	language		char(2) references language_codes,
	mime_type		varchar(100) not null,
	one_line_summary	varchar(200) not null,
	body			clob,
	editorial_status	varchar(30) 
          check (editorial_status in ('submitted','rejected','approved','expired'))
);

create view comments_on_articles_approved 
as
select * 
from comments_on_articles_raw
where editorial_status = 'approved';
This table differs from the articles table only in a single column: refers_to. How about combining the two:
create table content_raw (
	content_id		integer primary key,
	-- if not NULL, this row represents a comment
	refers_to		references content_raw,
	-- who contributed this and when
	creation_user		not null references users,
	creation_date		not null date,
	-- what language is this in?
	-- visit http://www.w3.org/International/O-charset-lang
	-- to see the allowable 2-character codes (en is English, ja is Japanese)
	language		char(2) references language_codes,
	-- could be text/html or text/plain or some sort of XML document
	mime_type		varchar(100) not null,
	one_line_summary	varchar(200) not null,
	-- the entire article; 4 GB limit
	body			clob,
	editorial_status	varchar(30) 
          check (editorial_status in ('submitted','rejected','approved','expired'))
);

-- if we want to be able to write some scripts without having to think
-- about the fact that different content types are merged

create view articles_approved 
as
select * 
from content_raw
where refers_to is null
and editorial_status = 'approved';

create view comments_on_articles_approved 
as
select * 
from content_raw
where refers_to is not null
and editorial_status = 'approved';

News Information

Discussion

Why Not Flat Files

Why Not Flat Files, part II

Why Not Flat Files, part III

About this document ...

This document was generated using the LaTeX2HTML translator Version 2002 (1.62)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html lecture_5 -split 0 -init_file ./.latex2html-initOne -t 'Content Management '

The translation was initiated by Sean Forman on 2005-09-14



Copyright© 2005, Saint Joseph's University and Sean Forman