f054e5d6c5ad7a67a4327e777b6fb12b738bbc53
[dbsrgits/DBM-Deep.git] / etc / mysql_tables.sql
1 DROP TABLE IF EXISTS `rec_array`;
2 CREATE TABLE `rec_array` (
3   `id` bigint(20) unsigned NOT NULL,
4   PRIMARY KEY (`id`)
5 );
6
7 DROP TABLE IF EXISTS `rec_array_item`;
8 CREATE TABLE `rec_array_item` (
9   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
10   `array` bigint(20) NOT NULL,
11   `pos` bigint(20) NOT NULL,
12   `value_data` varchar(255) DEFAULT NULL,
13   `value_type` enum('array','data','hash','text','value') NOT NULL DEFAULT 'value',
14   PRIMARY KEY (`id`),
15   UNIQUE KEY `array_2` (`array`,`pos`)
16 );
17
18 DROP TABLE IF EXISTS `rec_hash`;
19 CREATE TABLE `rec_hash` (
20   `id` bigint(20) unsigned NOT NULL,
21   PRIMARY KEY (`id`)
22 );
23
24 DROP TABLE IF EXISTS `rec_hash_item`;
25 CREATE TABLE `rec_hash_item` (
26   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
27   `hash` bigint(20) NOT NULL,
28   `key_data` varchar(255) DEFAULT NULL,
29   `key_hash` varchar(22) NOT NULL,
30   `key_type` enum('text','value') NOT NULL DEFAULT 'value',
31   `value_data` varchar(255) DEFAULT NULL,
32   `value_type` enum('array','data','hash','text','value') NOT NULL DEFAULT 'value',
33   PRIMARY KEY (`id`),
34   UNIQUE KEY `hash_2` (`hash`,`key_hash`)
35 );
36
37 DROP TABLE IF EXISTS `rec_item`;
38 CREATE TABLE `rec_item` (
39   `id` bigint(20) NOT NULL AUTO_INCREMENT,
40   `item_type` enum('array','hash') NOT NULL DEFAULT 'hash',
41   PRIMARY KEY (`id`)
42 );
43
44 DROP TABLE IF EXISTS `rec_value_data`;
45 CREATE TABLE `rec_value_data` (
46   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
47   `data` longblob NOT NULL,
48   PRIMARY KEY (`id`)
49 );
50
51 DROP TABLE IF EXISTS `rec_value_text`;
52 CREATE TABLE `rec_value_text` (
53   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
54   `data` longtext NOT NULL,
55   PRIMARY KEY (`id`)
56 );
57