понедельник, 2 января 2012 г.

SQL 2janv

# Dumping database structure for shoping
CREATE DATABASE IF NOT EXISTS `shoping` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `shoping`;

# Dumping structure for table shoping.countproducts
CREATE TABLE IF NOT EXISTS `countproducts` (
  `coChangeDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `prCode` varchar(10) NOT NULL,
  `coChangeCount` int(10) NOT NULL,
  `coSession` char(40) NOT NULL,
  `coChangeType` enum('INP','OUT','RES','BAL') NOT NULL,
  PRIMARY KEY (`coChangeDate`),
  KEY `prCode` (`prCode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

# Dumping structure for table shoping.listcategory
CREATE TABLE IF NOT EXISTS `listcategory` (
  `liCategoryId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `liCategoryName` varchar(50) NOT NULL,
  `liPositionOnView` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`liCategoryId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

# Dumping structure for table shoping.pages
CREATE TABLE IF NOT EXISTS `pages` (
  `paUrl` varchar(50) NOT NULL,
  `paHtml` text NOT NULL,
  `paViewCount` int(10) unsigned NOT NULL DEFAULT '0',
  UNIQUE KEY `paUrl` (`paUrl`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

# Dumping structure for table shoping.payment
CREATE TABLE IF NOT EXISTS `payment` (
  `ID` int(10) unsigned NOT NULL,
  `coSession` char(40) NOT NULL,
  `paSumm` int(10) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

# Dumping structure for table shoping.products
CREATE TABLE IF NOT EXISTS `products` (
  `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `prCode` varchar(10) NOT NULL,
  `liCategoryId` int(10) unsigned NOT NULL,
  `prSalesBegining` date NOT NULL,
  `prName` varchar(150) NOT NULL,
  `prRelatedProdIdCsv` text NOT NULL,
  `prDescriptionLat` text NOT NULL,
  `prDescriptionRus` text NOT NULL,
  `prDescriptionEng` text NOT NULL,
  `prPhotoUrl` text NOT NULL,
  `prManufacturedUrl` text NOT NULL,
  `prPriceLvl` int(10) NOT NULL DEFAULT '0',
  `prTax` int(10) NOT NULL DEFAULT '0',
  `prDiscount` int(10) NOT NULL DEFAULT '0',
  `prMaxDiscount` int(10) NOT NULL DEFAULT '0',
  `prStorageCount` int(10) NOT NULL DEFAULT '0',
  `prDeliveryDayPlus` int(10) NOT NULL DEFAULT '0',
  `prDeliveryPrice` int(10) NOT NULL DEFAULT '0',
  `prForSale` enum('Y','N') NOT NULL DEFAULT 'Y',
  `prForCustomerType` int(1) unsigned NOT NULL DEFAULT '0',
  `prPositionOnView` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  KEY `prCode` (`prCode`),
  KEY `prCategoryId` (`liCategoryId`),
  KEY `prSalesBegining` (`prSalesBegining`),
  FULLTEXT KEY `prName` (`prName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Комментариев нет:

Отправить комментарий