File: mysql_tables.sql

package info (click to toggle)
libdbm-deep-perl 2.0008-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 884 kB
  • sloc: perl: 7,383; sql: 36
file content (20 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
DROP TABLE IF EXISTS datas;
DROP TABLE IF EXISTS refs;

CREATE TABLE refs (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
   ,ref_type ENUM( 'H', 'A' ) NOT NULL DEFAULT 'H'
   ,refcount BIGINT UNSIGNED NOT NULL DEFAULT 1
   ,classname LONGTEXT
) ENGINE=MyISAM;

CREATE TABLE datas (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
   ,ref_id BIGINT UNSIGNED NOT NULL
   ,data_type ENUM( 'S', 'R' ) DEFAULT 'S'
   ,`key` LONGTEXT NOT NULL
   ,value LONGTEXT
   ,FOREIGN KEY (ref_id) REFERENCES refs (id)
        ON DELETE CASCADE ON UPDATE CASCADE
   ,UNIQUE INDEX (ref_id, `key` (700) )
) ENGINE=MyISAM;