Got some basic functionality working. Still isn't fully functional (only the specifie...
[dbsrgits/DBM-Deep.git] / etc / mysql_tables.sql
CommitLineData
a4d36ff6 1DROP TABLE IF EXISTS datas;
2DROP TABLE IF EXISTS refs;
3
4CREATE TABLE refs (
18bc2fa6 5 id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
a4d36ff6 6 ,ref_type ENUM( 'H', 'A' ) NOT NULL DEFAULT 'H'
18bc2fa6 7 ,refcount BIGINT UNSIGNED NOT NULL DEFAULT 1
4f0f6fff 8);
9
a4d36ff6 10CREATE TABLE datas (
18bc2fa6 11 id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
a4d36ff6 12 ,ref_id BIGINT UNSIGNED NOT NULL
13 ,data_type ENUM( 'S', 'R' ) DEFAULT 'S'
14 ,`key` TEXT NOT NULL
18bc2fa6 15 ,value TEXT
16 ,class TEXT
a4d36ff6 17 ,FOREIGN KEY (ref_id) REFERENCES refs (id)
18 ON DELETE CASCADE ON UPDATE CASCADE
19 ,UNIQUE INDEX (ref_id, `key` (900) )
4f0f6fff 20);