File: parts-schema.sql

package info (click to toggle)
libdbix-dbstag-perl 0.12-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,420 kB
  • sloc: perl: 6,152; sql: 588; xml: 221; lisp: 59; makefile: 20
file content (14 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CREATE TABLE component (
        component_id SERIAL NOT NULL PRIMARY KEY,
        name    VARCHAR(32) NOT NULL,
        descr   TEXT,

        UNIQUE (name)
);
CREATE TABLE part_of (
        part_of_id SERIAL NOT NULL PRIMARY KEY,
        subject_id INTEGER NOT NULL REFERENCES component(component_id),
        object_id INTEGER NOT NULL REFERENCES component(component_id),

        UNIQUE (subject_id,object_id)
);