root/branch/zion/umit/zion/db/model.sql @ 5128

Revision 5128, 1.7 kB (checked in by ignotus, 4 years ago)

Added SQL database creation code. And SQLite3 database file.

Line 
1CREATE TABLE software(
2-- Attributes --
3pk integer,
4fk_vendor integer,
5fk_type integer,
6fk_name integer,
7fk_note integer,
8description text,
9added datetime,
10updated datetime);
11
12CREATE TABLE fingerprint(
13-- Attributes --
14pk integer,
15fk_sig1 integer,
16fk_raw1 integer,
17added datetime,
18updated datetime,
19fk_software integer);
20
21CREATE TABLE s_attractor(
22-- Attributes --
23pk interger,
24samples integer,
25fp blob,
26description text);
27
28CREATE TABLE r_tcpisn(
29-- Attributes --
30pk integer,
31samples integer,
32series blob,
33description text);
34
35CREATE TABLE vendor(
36-- Attributes --
37pk integer,
38name text,
39description text);
40
41CREATE TABLE type(
42-- Attributes --
43pk integer,
44name text,
45description text);
46
47CREATE TABLE name(
48-- Attributes --
49pk integer,
50name text,
51version text,
52description text);
53
54CREATE TABLE note(
55-- Attributes --
56pk integer,
57note text,
58keywords text);
59
60
61
62-- ALTER TABLE note ADD
63--     CONSTRAINT  FK_note_software  FOREIGN KEY(unnamed) REFERENCES software (unnamed);
64
65
66-- ALTER TABLE type ADD
67--     CONSTRAINT  FK_type_software  FOREIGN KEY(unnamed) REFERENCES software (unnamed);
68
69
70-- ALTER TABLE s_attractor ADD
71--     CONSTRAINT  FK_s_attractor_fingerprint  FOREIGN KEY(unnamed) REFERENCES fingerprint (unnamed);
72
73
74-- ALTER TABLE r_tcpisn ADD
75--     CONSTRAINT  FK_r_tcpisn_fingerprint  FOREIGN KEY(unnamed) REFERENCES fingerprint (unnamed);
76
77
78-- ALTER TABLE software ADD
79--     CONSTRAINT  FK_software_fingerprint  FOREIGN KEY(unnamed) REFERENCES fingerprint (unnamed);
80
81
82-- ALTER TABLE software ADD
83--     CONSTRAINT  FK_software_vendor  FOREIGN KEY(unnamed) REFERENCES vendor (unnamed);
84
85
86-- ALTER TABLE software ADD
87--     CONSTRAINT  FK_software_name  FOREIGN KEY(unnamed) REFERENCES name (unnamed);
Note: See TracBrowser for help on using the browser.