1 DROP TABLE IF EXISTS datas;
2 DROP TABLE IF EXISTS refs;
5 id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
6 ,ref_type ENUM( 'H', 'A' ) NOT NULL DEFAULT 'H'
7 ,refcount BIGINT UNSIGNED NOT NULL DEFAULT 1
12 id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
13 ,ref_id BIGINT UNSIGNED NOT NULL
14 ,data_type ENUM( 'S', 'R' ) DEFAULT 'S'
15 ,`key` LONGTEXT NOT NULL
17 ,FOREIGN KEY (ref_id) REFERENCES refs (id)
18 ON DELETE CASCADE ON UPDATE CASCADE
19 ,UNIQUE INDEX (ref_id, `key` (700) )