# MySQL dump 7.1
#
# Host: localhost Database: mymarket
#--------------------------------------------------------
# Server version 3.22.32
#
# Table structure for table 'categories'
#
CREATE TABLE categories (
id int(11) DEFAULT '0' NOT NULL auto_increment,
parent_id int(11) DEFAULT '1' NOT NULL,
name varchar(25) DEFAULT '' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id),
KEY parent_id (parent_id),
KEY name (name)
);
#
# Table structure for table 'order_items'
#
CREATE TABLE order_items (
order_id int(11) DEFAULT '0' NOT NULL,
product_id int(11) DEFAULT '0' NOT NULL,
price float(5,2) DEFAULT '0.00' NOT NULL,
qty int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (order_id,product_id)
);
#
# Table structure for table 'orders'
#
CREATE TABLE orders (
id int(11) DEFAULT '0' NOT NULL auto_increment,
username varchar(16) DEFAULT '' NOT NULL,
o_timestamp datetime,
a_timestamp datetime,
status tinyint(4),
status_details varchar(255),
custinfo text,
comments text,
amount float(5,2),
PRIMARY KEY (id),
KEY username (username)
);
#
# Table structure for table 'products'
#
CREATE TABLE products (
id int(11) DEFAULT '0' NOT NULL auto_increment,
name varchar(25) DEFAULT '' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
price float(5,2) DEFAULT '0.00' NOT NULL,
on_special tinyint(4) DEFAULT '0' NOT NULL,
timestamp timestamp(14) NOT NULL,
PRIMARY KEY (id),
KEY name (name)
);
#
# Table structure for table 'products_categories'
#
CREATE TABLE products_categories (
product_id int(11) DEFAULT '0' NOT NULL,
category_id int(11) DEFAULT '1' NOT NULL,
PRIMARY KEY (product_id,category_id)
);
#
# Table structure for table 'users'
#
CREATE TABLE users (
username varchar(16) DEFAULT '' NOT NULL,
password varchar(32) DEFAULT '' NOT NULL,
priv varchar(5) DEFAULT '' NOT NULL,
firstname varchar(64) DEFAULT '' NOT NULL,
lastname varchar(64) DEFAULT '' NOT NULL,
email varchar(128) DEFAULT '' NOT NULL,
phone varchar(32) DEFAULT '' NOT NULL,
address varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (username),
UNIQUE email (email)
);