|
Revision 5128, 1.7 kB
(checked in by ignotus, 4 years ago)
|
|
Added SQL database creation code. And SQLite3 database file.
|
| Line | |
|---|
| 1 | CREATE TABLE software( |
|---|
| 2 | -- Attributes -- |
|---|
| 3 | pk integer, |
|---|
| 4 | fk_vendor integer, |
|---|
| 5 | fk_type integer, |
|---|
| 6 | fk_name integer, |
|---|
| 7 | fk_note integer, |
|---|
| 8 | description text, |
|---|
| 9 | added datetime, |
|---|
| 10 | updated datetime); |
|---|
| 11 | |
|---|
| 12 | CREATE TABLE fingerprint( |
|---|
| 13 | -- Attributes -- |
|---|
| 14 | pk integer, |
|---|
| 15 | fk_sig1 integer, |
|---|
| 16 | fk_raw1 integer, |
|---|
| 17 | added datetime, |
|---|
| 18 | updated datetime, |
|---|
| 19 | fk_software integer); |
|---|
| 20 | |
|---|
| 21 | CREATE TABLE s_attractor( |
|---|
| 22 | -- Attributes -- |
|---|
| 23 | pk interger, |
|---|
| 24 | samples integer, |
|---|
| 25 | fp blob, |
|---|
| 26 | description text); |
|---|
| 27 | |
|---|
| 28 | CREATE TABLE r_tcpisn( |
|---|
| 29 | -- Attributes -- |
|---|
| 30 | pk integer, |
|---|
| 31 | samples integer, |
|---|
| 32 | series blob, |
|---|
| 33 | description text); |
|---|
| 34 | |
|---|
| 35 | CREATE TABLE vendor( |
|---|
| 36 | -- Attributes -- |
|---|
| 37 | pk integer, |
|---|
| 38 | name text, |
|---|
| 39 | description text); |
|---|
| 40 | |
|---|
| 41 | CREATE TABLE type( |
|---|
| 42 | -- Attributes -- |
|---|
| 43 | pk integer, |
|---|
| 44 | name text, |
|---|
| 45 | description text); |
|---|
| 46 | |
|---|
| 47 | CREATE TABLE name( |
|---|
| 48 | -- Attributes -- |
|---|
| 49 | pk integer, |
|---|
| 50 | name text, |
|---|
| 51 | version text, |
|---|
| 52 | description text); |
|---|
| 53 | |
|---|
| 54 | CREATE TABLE note( |
|---|
| 55 | -- Attributes -- |
|---|
| 56 | pk integer, |
|---|
| 57 | note text, |
|---|
| 58 | keywords 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); |
|---|