?

Log in

Changed SQL - Online Creativness [entries|archive|friends|userinfo]
Online Creativness

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Changed SQL [Aug. 17th, 2002|10:22 pm]
Online Creativness

online_create

[tmtl]
use online_create;

DROP TABLE IF EXISTS stories;
DROP TABLE IF EXISTS poems;
DROP TABLE IF EXISTS lyrics;
DROP TABLE IF EXISTS types;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS styles;

CREATE TABLE stories (
storyid smallint(5) unsigned NOT NULL auto_increment,
uid smallint(5) unsigned NOT NULL default '0',
security_type enum('0','1','2') NOT NULL default '0',
story_title varchar(40) default NULL,
story_text text,
story_written_by varchar(40) default NULL,
story_deleted enum('0','1') NOT NULL default '0',
story_a_comments enum('0','1') NOT NULL default '0',
story_num_comments tinyint(4) default '0',
PRIMARY KEY (storyid)
) TYPE=MyISAM;

CREATE TABLE poems (
poemid smallint(5) unsigned NOT NULL auto_increment,
uid smallint(5) unsigned NOT NULL default '0',
security_type enum('0','1','2') NOT NULL default '0',
poem_title varchar(40) default NULL,
poem_text text,
poem_written_by varchar(40) default NULL,
poem_deleted enum('0','1') NOT NULL default '0',
poem_a_comments enum('0','1') NOT NULL default '0',
poem_num_comments tinyint(4) default '0',
PRIMARY KEY (poemid)
) TYPE=MyISAM;

CREATE TABLE lyrics (
lyricid smallint(5) unsigned NOT NULL auto_increment,
uid smallint(5) unsigned NOT NULL default '0',
security_type enum('0','1','2') NOT NULL default '0',
lyric_title varchar(40) default NULL,
lyric_text text,
lyric_written_by varchar(40) default NULL,
lyric_from_album varchar(40) default NULL,
lyric_deleted enum('0','1') NOT NULL default '0',
lyric_a_comments enum('0','1') NOT NULL default '0',
lyric_num_comments tinyint(4) default '0',
PRIMARY KEY (lyricid)
) TYPE=MyISAM;

CREATE TABLE types (
typeid smallint(5) unsigned NOT NULL auto_increment,
typename varchar(20) NOT NULL default 'Empty data type',
PRIMARY KEY (typeid)
) TYPE=MyISAM;

# I'm not sure why I created this "types" table ...

CREATE TABLE users (
userid smallint(5) unsigned NOT NULL auto_increment,
username varchar(20) default NULL,
firstname varchar(20) default NULL,
lastname varchar(20) default NULL,
password varchar(15) default NULL,
account_type tinyint(3) unsigned NOT NULL default '1',
email varchar(40) default NULL,
dob date default '2002-08-01',
confirmation varchar(10) default NULL,
confirmed enum('0','1') default '0',
deleted enum('0','1') default '0',
default_style smallint(5) default '1',
valid varchar(1) default '1',
website varchar(100) default '',
bio text,
hasbio enum('y','n') default 'n',
showem enum('y','n') default 'y',
lastmod datetime default '2002-08-17 17:20:00',
PRIMARY KEY (userid),
UNIQUE KEY username (username)
) TYPE=MyISAM;

# There was a reason for "valid" and "hasbio" but I forget what

CREATE TABLE styles (
styleid smallint(5) unsigned NOT NULL auto_increment default '0',
styleowner smallint(5) unsigned NOT NULL default '0',
styledef text,
titles text,
texts text,
written text,
uploaded text,
PRIMARY KEY (styleid)
);

This table isn't fully used yet
linkReply