Anonim / 2 years, 2 months ago | Download | Plaintext | Odpowiedz |

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# --------------------------------------------------------
# Host:                         192.168.1.109
# Server version:               5.6.4-m7-log
# Server OS:                    debian5.0
# HeidiSQL version:             6.0.0.3603
# Date/time:                    2012-02-09 10:02:27
# --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

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


# Dumping structure for table exampleDB.insurance
CREATE TABLE IF NOT EXISTS `insurance` (
  `idInsurance` int(10) unsigned NOT NULL,
  `idItem` int(10) unsigned DEFAULT NULL,
  `idInsuranceFirm` tinyint(3) unsigned NOT NULL,
  `idInsuranceType` tinyint(3) unsigned NOT NULL,
  `value` decimal(9,2) NOT NULL,
  `mTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `settings` text,
  `auto` tinyint(1) NOT NULL DEFAULT '1',
  `document` mediumtext,
  PRIMARY KEY (`idInsurance`),
  KEY `fk_insurance_insuranceFirm` (`idInsuranceFirm`),
  KEY `fk_insurance_insuranceType` (`idInsuranceType`),
  KEY `fk_insurance_item` (`idItem`),
  CONSTRAINT `fk_insurance_insuranceFirm` FOREIGN KEY (`idInsuranceFirm`) REFERENCES `insuranceFirm` (`idInsuranceFirm`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_insurance_insuranceType` FOREIGN KEY (`idInsuranceType`) REFERENCES `insuranceType` (`idInsuranceType`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_insurance_item` FOREIGN KEY (`idItem`) REFERENCES `item` (`idItem`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.insurance: ~0 rows (approximately)
/*!40000 ALTER TABLE `insurance` DISABLE KEYS */;
/*!40000 ALTER TABLE `insurance` ENABLE KEYS */;


# Dumping structure for table exampleDB.insuranceFirm
CREATE TABLE IF NOT EXISTS `insuranceFirm` (
  `idInsuranceFirm` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) NOT NULL,
  `filename` varchar(60) DEFAULT NULL,
  `expire` datetime DEFAULT NULL,
  `data` mediumblob,
  `md5sum` varchar(45) DEFAULT NULL,
  `auto` tinyint(1) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idInsuranceFirm`),
  UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.insuranceFirm: ~0 rows (approximately)
/*!40000 ALTER TABLE `insuranceFirm` DISABLE KEYS */;
/*!40000 ALTER TABLE `insuranceFirm` ENABLE KEYS */;


# Dumping structure for table exampleDB.insuranceType
CREATE TABLE IF NOT EXISTS `insuranceType` (
  `idInsuranceType` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(45) NOT NULL DEFAULT '',
  `enabled` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idInsuranceType`),
  UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.insuranceType: ~0 rows (approximately)
/*!40000 ALTER TABLE `insuranceType` DISABLE KEYS */;
/*!40000 ALTER TABLE `insuranceType` ENABLE KEYS */;


# Dumping structure for table exampleDB.item
CREATE TABLE IF NOT EXISTS `item` (
  `idItem` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idOffer` int(10) unsigned NOT NULL,
  `idCar` int(11) NOT NULL,
  `idInsurance` int(10) unsigned NOT NULL DEFAULT '1',
  `idDealer` int(11) NOT NULL DEFAULT '1',
  `idAssistance` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `idFuelCard` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `idService` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`idItem`),
  KEY `fk_item_offer` (`idOffer`),
  KEY `fk_item_car` (`idCar`),
  KEY `fk_item_dealer` (`idDealer`),
  KEY `fk_item_assistance` (`idAssistance`),
  KEY `fk_item_fuelCard` (`idFuelCard`),
  KEY `fk_item_service` (`idService`),
  KEY `fk_item_insurance` (`idInsurance`),
  CONSTRAINT `FK_item_insurance` FOREIGN KEY (`idInsurance`) REFERENCES `insurance` (`idInsurance`),
  CONSTRAINT `fk_item_offer` FOREIGN KEY (`idOffer`) REFERENCES `offer` (`idOffer`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_item_service` FOREIGN KEY (`idService`) REFERENCES `service` (`idService`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.item: ~0 rows (approximately)
/*!40000 ALTER TABLE `item` DISABLE KEYS */;
/*!40000 ALTER TABLE `item` ENABLE KEYS */;


# Dumping structure for table exampleDB.offer
CREATE TABLE IF NOT EXISTS `offer` (
  `idOffer` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `status` char(3) NOT NULL DEFAULT '100',
  PRIMARY KEY (`idOffer`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.offer: ~1 rows (approximately)
/*!40000 ALTER TABLE `offer` DISABLE KEYS */;
INSERT INTO `offer` (`idOffer`, `status`) VALUES
	(1, '100');
/*!40000 ALTER TABLE `offer` ENABLE KEYS */;


# Dumping structure for table exampleDB.service
CREATE TABLE IF NOT EXISTS `service` (
  `idService` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idItem` int(10) unsigned DEFAULT NULL,
  `idServiceType` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `auto` tinyint(1) NOT NULL DEFAULT '1',
  `value` decimal(6,2) NOT NULL DEFAULT '0.00',
  `mTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `settings` text,
  PRIMARY KEY (`idService`),
  KEY `fk_service_item` (`idItem`),
  KEY `fk_service_serviceType` (`idServiceType`),
  CONSTRAINT `fk_service_item` FOREIGN KEY (`idItem`) REFERENCES `item` (`idItem`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_service_serviceType` FOREIGN KEY (`idServiceType`) REFERENCES `serviceType` (`idServiceType`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.service: ~0 rows (approximately)
/*!40000 ALTER TABLE `service` DISABLE KEYS */;
/*!40000 ALTER TABLE `service` ENABLE KEYS */;


# Dumping structure for table exampleDB.serviceType
CREATE TABLE IF NOT EXISTS `serviceType` (
  `idServiceType` tinyint(3) unsigned NOT NULL,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) NOT NULL DEFAULT '',
  `enabled` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idServiceType`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# Dumping data for table exampleDB.serviceType: ~0 rows (approximately)
/*!40000 ALTER TABLE `serviceType` DISABLE KEYS */;
/*!40000 ALTER TABLE `serviceType` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;