Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 163 lines (137 sloc) 5.438 kb
9970143 @gaubert add sqlite3 support
authored
1 -- create RODD SCHEMA or DATABASE if not there
2
3 DROP TABLE if EXISTS products;
4 DROP TABLE if EXISTS products_formats;
5 DROP TABLE if EXISTS format_type;
6 DROP TABLE if EXISTS file_info;
69db691 @gaubert add support for sqlite3
authored
7 DROP TABLE if EXISTS channels;
8 DROP TABLE if EXISTS service_dirs;
9 DROP TABLE if EXISTS servdirs_2_families;
10 DROP TABLE if EXISTS file_2_servdirs;
11 DROP TABLE if EXISTS products_2_fileinfo;
81545c1 @gaubert add test suite validating product, servicedirs and channels functionalit...
authored
12 DROP TABLE if EXISTS fileinfo_2_distribution;
9970143 @gaubert add sqlite3 support
authored
13
14
15 -- Create the tables
16
17 -- users
18 CREATE TABLE IF NOT EXISTS users (
69db691 @gaubert add support for sqlite3
authored
19 user_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
20 login VARCHAR(255) NOT NULL,
21 password VARCHAR(255) NOT NULL,
22 email VARCHAR(255) NOT NULL
23 );
24
25 -- information regarding products
26 CREATE TABLE IF NOT EXISTS products (
69db691 @gaubert add support for sqlite3
authored
27 rodd_id INTEGER PRIMARY KEY AUTOINCREMENT ,
9970143 @gaubert add sqlite3 support
authored
28 internal_id VARCHAR(256) UNIQUE,
29 title VARCHAR(255) NOT NULL,
30 description VARCHAR(2048) NOT NULL,
31 is_disseminated BOOLEAN,
32 status VARCHAR(256)
33 );
34
35 -- information regarding the distributionTypes
36 CREATE TABLE IF NOT EXISTS distribution_type (
69db691 @gaubert add support for sqlite3
authored
37 dis_id INTEGER PRIMARY KEY AUTOINCREMENT,
cd5231b @gaubert add data automatically from eo-portal in db. optimize requests
authored
38 name VARCHAR(255) NOT NULL,
39 geo VARCHAR(255) NOT NULL
9970143 @gaubert add sqlite3 support
authored
40 );
41
cd5231b @gaubert add data automatically from eo-portal in db. optimize requests
authored
42 INSERT into distribution_type (name, geo) values("eumetcast-info","world");
43 INSERT into distribution_type (name, geo) values("gts-info", "world");
44 INSERT into distribution_type (name, geo) values("direct-info", "world");
45 INSERT into distribution_type (name, geo) values("geonetcast-info", "world");
46 INSERT into distribution_type (name, geo) values("data-centre-info", "world");
9970143 @gaubert add sqlite3 support
authored
47
48 -- information regarding the file_info
49 CREATE TABLE IF NOT EXISTS file_info (
69db691 @gaubert add support for sqlite3
authored
50 file_id INTEGER PRIMARY KEY AUTOINCREMENT ,
9970143 @gaubert add sqlite3 support
authored
51 name VARCHAR(255) UNIQUE NOT NULL,
52 reg_expr VARCHAR(255),
53 size VARCHAR(255),
54 type VARCHAR(255) NOT NULL
55 );
56
57 -- information regarding the channels
58 CREATE TABLE IF NOT EXISTS channels (
69db691 @gaubert add support for sqlite3
authored
59 chan_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
60 name VARCHAR(512) UNIQUE NOT NULL,
61 multicast_address VARCHAR(512),
69db691 @gaubert add support for sqlite3
authored
62 min_rate INTEGER,
63 max_rate INTEGER,
9970143 @gaubert add sqlite3 support
authored
64 channel_function VARCHAR(512),
65 pid_EB9 INTEGER,
66 pid_AB3 INTEGER,
67 pid_NSS INTEGER
68 );
69
70 -- information regarding the service directories
71 CREATE TABLE IF NOT EXISTS service_dirs (
69db691 @gaubert add support for sqlite3
authored
72 serv_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
73 name VARCHAR(255) UNIQUE NOT NULL,
81545c1 @gaubert add test suite validating product, servicedirs and channels functionalit...
authored
74 chan_id VARCHAR(256) NOT NULL
9970143 @gaubert add sqlite3 support
authored
75 );
76
77 -- relation between products and file_info
78 CREATE TABLE IF NOT EXISTS products_2_fileinfo (
79 rodd_id INTEGER,
80 file_id INTEGER
81 );
82
83 -- relation between fileinfo and distributions
84 CREATE TABLE IF NOT EXISTS fileinfo_2_distribution (
85 file_id INTEGER,
86 dis_id INTEGER
87 );
88
89 -- information regarding file2servdirs
90 CREATE TABLE IF NOT EXISTS file_2_servdirs (
91 file_id INTEGER,
92 serv_id INTEGER
93 );
94
95 -- information regarding the families
96 CREATE TABLE IF NOT EXISTS families (
69db691 @gaubert add support for sqlite3
authored
97 fam_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
98 name VARCHAR(512),
99 description VARCHAR(2048)
100 );
101
102 -- information regarding the families
103 CREATE TABLE IF NOT EXISTS servdirs_2_families (
104 serv_id INTEGER,
105 fam_id INTEGER
106 );
69db691 @gaubert add support for sqlite3
authored
107 CREATE INDEX IF NOT EXISTS serv2fam_servid_index ON servdirs_2_families (serv_id);
108 CREATE INDEX IF NOT EXISTS serv2fam_famid_index ON servdirs_2_families (fam_id);
9970143 @gaubert add sqlite3 support
authored
109
110
111 -- products formats to link the formats and the products
112 CREATE TABLE IF NOT EXISTS products_formats (
113 roddID INTEGER PRIMARY KEY,
114 formatTypeID INTEGER
115 );
116
117 -- format type
118 CREATE TABLE IF NOT EXISTS format_type (
69db691 @gaubert add support for sqlite3
authored
119 format_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
120 name VARCHAR(256),
121 description VARCHAR(1024)
122 );
123
124 -- insert the different format types
125 INSERT into format_type (name) values("AAPP");
126 INSERT into format_type (name,description) values("ASCII","ASCII file");
127 INSERT into format_type (name) values("AWX");
128 INSERT into format_type (name,description) values("BZIP2-BUFR","Bzip2 compressed BUFR");
129 INSERT into format_type (name) values("BUFR");
130 INSERT into format_type (name) values("GEOTIFF");
131 INSERT into format_type (name) values("GIF");
132 INSERT into format_type (name) values("GRIB");
133 INSERT into format_type (name) values("HDF");
134 INSERT into format_type (name) values("HDF5");
135 INSERT into format_type (name) values("HDF-EOS");
136 INSERT into format_type (name,description) values("BZIP2-HRPT","Raw HRPT bzip2 compressed");
137 INSERT into format_type (name,description) values("HRIT","Lossless wavelet compressed");
138 INSERT into format_type (name) values("JPEG");
139 INSERT into format_type (name) values("Lossy JPEG");
140 INSERT into format_type (name,description) values("LRIT","Wavelet compressed");
141 INSERT into format_type (name) values("MPEG");
142 INSERT into format_type (name) values("Native Binary");
143 INSERT into format_type (name) values("NetCDF");
144 INSERT into format_type (name) values("PFS");
145 INSERT into format_type (name) values("PNG");
146 INSERT into format_type (name) values("Shape");
147 INSERT into format_type (name,description) values("LRIT-WMO","WMO GTS in LRIT");
148
149 -- orbit type
150 CREATE TABLE IF NOT EXISTS orbit_type (
69db691 @gaubert add support for sqlite3
authored
151 orbit_id INTEGER PRIMARY KEY AUTOINCREMENT,
9970143 @gaubert add sqlite3 support
authored
152 name VARCHAR(256)
153 );
154
155 INSERT into orbit_type (name) values("LEO");
156 INSERT into orbit_type (name) values("GEO");
157
158 -- status, instrument, frequency, should be expressed differently
159 -- for frequency, it will be very difficult
160
161
162
Something went wrong with that request. Please try again.