# --------------------------------------------------------------------------
#
# INDEXU(tm) v.3.0.3
# Copyright(C), Sentraweb, 2001, All Rights Reserved.
#
# INDEXU(tm) is protected by Indonesia and International copyright laws.
# Unauthorized use or distribution of INDEXU(tm) is strictly prohibited,
# violators will be prosecuted. To obtain a license for using INDEXU(tm), 
# please register at INDEXU home page at indexu.com
#
# Author: Dody Rachmat Wicaksono (dody@sentraweb.com) 
#
# 26-Des-2001
#
# --------------------------------------------------------------------------



# --------------------------------------------------------
#
# Table structure for table 'idx_bad_link'
#

CREATE TABLE idx_bad_link (
   bad_link_id mediumint(8) unsigned NOT NULL auto_increment,
   link_id mediumint(8) unsigned NOT NULL,
   name varchar(50) NOT NULL,
   email varchar(50) NOT NULL,
   type tinyint(3) unsigned NOT NULL,
   date date DEFAULT '0000-00-00' NOT NULL,
   PRIMARY KEY (bad_link_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_category'
#

CREATE TABLE idx_category (
   category_id smallint(5) unsigned NOT NULL auto_increment,
   parent_id smallint(5) unsigned NOT NULL,
   name varchar(100) NOT NULL,
   description text NOT NULL,
   image varchar(100),
   content text,
   visible char(1),
   links mediumint(9),
   meta_keyword text,
   meta_description text,
   permission char(2),
   registered_only char(1),
   PRIMARY KEY (category_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_category_in_order'
#

CREATE TABLE idx_category_in_order (
   category_id smallint(5) unsigned
);


# --------------------------------------------------------
#
# Table structure for table 'idx_editor'
#

CREATE TABLE idx_editor (
   username varchar(20),
   category_id smallint(5),
   category char(1),
   link char(1),
   review char(1),
   pick char(1),
   status char(1),
   date date
);


# --------------------------------------------------------
#
# Table structure for table 'idx_favorites'
#

CREATE TABLE idx_favorites (
   favorite_id int(11) NOT NULL auto_increment,
   username varchar(20),
   date date,
   title varchar(100),
   description text,
   PRIMARY KEY (favorite_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_favorites_detail'
#

CREATE TABLE idx_favorites_detail (
   favorite_id int(11),
   link_id mediumint(9)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_link'
#

CREATE TABLE idx_link (
   link_id mediumint(8) unsigned NOT NULL auto_increment,
   category_id smallint(5) unsigned NOT NULL,
   title varchar(100) NOT NULL,
   url text NOT NULL,
   description text NOT NULL,
   contact_name varchar(100) NOT NULL,
   email varchar(100) NOT NULL,
   hits mediumint(9),
   votes smallint(6),
   rating float(4,2),
   date date DEFAULT '0000-00-00' NOT NULL,
   bid smallint(6),
   new char(1),
   hot char(1),
   top_rated char(1),
   pick char(1),
   password varchar(20),
   updated char(1),
   reviews smallint(6),
   avg_review float(4,2),
   last_updated date,
   logo varchar(251),
   PRIMARY KEY (link_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_link_temp'
#

CREATE TABLE idx_link_temp (
   vid mediumint(8) unsigned NOT NULL auto_increment,
   link_id mediumint(8),
   category_id smallint(5) unsigned NOT NULL,
   title varchar(100) NOT NULL,
   url text NOT NULL,
   description text NOT NULL,
   contact_name varchar(100) NOT NULL,
   email varchar(100) NOT NULL,
   hits mediumint(9),
   votes smallint(6),
   rating float(4,2),
   date date DEFAULT '0000-00-00' NOT NULL,
   bid smallint(6),
   new char(1),
   hot char(1),
   top_rated char(1),
   pick char(1),
   password varchar(20),
   updated char(1),
   reviews smallint(6),
   avg_review float(4,2),
   last_updated date,
   logo varchar(251),
   PRIMARY KEY (vid)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_mailing_list'
#

CREATE TABLE idx_mailing_list (
   email varchar(100) NOT NULL,
   code varchar(4),
   status char(1),
   PRIMARY KEY (email)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_message'
#

CREATE TABLE idx_message (
   message_id smallint(6) NOT NULL auto_increment,
   date date,
   body text,
   subject varchar(100),
   PRIMARY KEY (message_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_rating'
#

CREATE TABLE idx_rating (
   rating tinyint(3) unsigned NOT NULL,
   name varchar(20)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_review'
#

CREATE TABLE idx_review (
   review_id mediumint(8) unsigned NOT NULL auto_increment,
   link_id mediumint(8) unsigned NOT NULL,
   review text NOT NULL,
   rating tinyint(3) unsigned NOT NULL,
   date date DEFAULT '0000-00-00' NOT NULL,
   subject varchar(100),
   status char(1),
   username varchar(20),
   PRIMARY KEY (review_id)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_searchlog'
#

CREATE TABLE idx_searchlog (
   keyword varchar(100) NOT NULL,
   time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   ip varchar(100),
   result mediumint(8) unsigned
);


# --------------------------------------------------------
#
# Table structure for table 'idx_users'
#

CREATE TABLE idx_users (
   username varchar(20),
   password varchar(20),
   name varchar(50),
   email varchar(50),
   theme varchar(20),
   date date,
   status char(1),
   vcode varchar(4),
   group_id tinyint(4),
   homepage varchar(100),
   icq varchar(20),
   aol varchar(20),
   yahoo varchar(20),
   biography text,
   location varchar(50),
   interest varchar(50),
   occupation varchar(50),
   nol_category tinyint(4),
   nol_search tinyint(4)
);


# --------------------------------------------------------
#
# Table structure for table 'idx_votes'
#

CREATE TABLE idx_votes (
   link_id mediumint(9),
   ip varchar(100),
   value tinyint(4)
);


