75
75
sentencia << wxT("cuids_in_study VARCHAR(250),");
76
76
sentencia << wxT("num_series INTEGER,");
77
77
sentencia << wxT("num_instances INTEGER,");
78
sentencia << wxT("location CHAR DEFAULT 'B',"); //B implies fully local L implies some files linked W implies some files wado linked
78
79
sentencia << wxT("created_time DATETIME DEFAULT CURRENT_TIMESTAMP,");
79
80
sentencia << wxT("updated_time DATETIME);");
80
81
dataBase.ExecuteUpdate(sentencia);
145
146
sentencia << wxT("num_instances INTEGER,");
146
147
sentencia << wxT("frame_of_reference_uid VARCHAR(250),");
147
148
sentencia << wxT("tuids_in_series VARCHAR(250),");
149
sentencia << wxT("location CHAR DEFAULT 'B',"); //B implies fully local L implies some files linked W implies some files wado linked
148
150
sentencia << wxT("created_time DATETIME DEFAULT CURRENT_TIMESTAMP,");
149
151
sentencia << wxT("updated_time DATETIME);");
150
152
dataBase.ExecuteUpdate(sentencia);
200
202
sentencia << wxT("ON Series(station_name);");
201
203
dataBase.ExecuteUpdate(sentencia);
205
sentencia = wxEmptyString;
206
sentencia << wxT("CREATE Index series_study ");
207
sentencia << wxT("ON Series(pk, study_fk);");
208
dataBase.ExecuteUpdate(sentencia);
211
sentencia = wxEmptyString;
212
sentencia << wxT("CREATE Index series_location ");
213
sentencia << wxT("ON Series(study_fk, location);");
214
dataBase.ExecuteUpdate(sentencia);
203
216
/** 1. Tabla de ficheros **/
204
217
sentencia = wxEmptyString;
205
218
sentencia << wxT("CREATE TABLE File (");
206
219
sentencia << wxT("pk INTEGER PRIMARY KEY,"); //autoincrement by default (SQLITE)
207
220
sentencia << wxT("series_fk INTEGER REFERENCES Series(pk) ON UPDATE CASCADE ON DELETE CASCADE,");
209
sentencia << wxT("file_path VARCHAR(256) COLLATE NOCASE,");
222
sentencia << wxT("file_path VARCHAR(1024) COLLATE NOCASE,");
211
sentencia << wxT("file_path VARCHAR(256),");
224
sentencia << wxT("file_path VARCHAR(1024),");
213
226
sentencia << wxT("file_sopiuid VARCHAR(240),");
214
227
sentencia << wxT("file_tsuid VARCHAR(240),");
227
240
sentencia << wxT("file_desc VARCHAR(240),");
228
241
sentencia << wxT("spacing VARCHAR(240),");
229
242
sentencia << wxT("direction_cosines VARCHAR(240),");
243
sentencia << wxT("location CHAR DEFAULT 'B',"); //B implies fully local L implies some files linked W implies some files wado linked
230
244
sentencia << wxT("created_time DATETIME DEFAULT CURRENT_TIMESTAMP,");
231
245
sentencia << wxT("updated_time DATETIME);");
232
246
dataBase.ExecuteUpdate(sentencia);
270
284
sentencia << wxT("CREATE Index sopcuid ");
271
285
sentencia << wxT("ON File(sopcuid);");
272
286
dataBase.ExecuteUpdate(sentencia);
287
sentencia = wxEmptyString;
289
sentencia = wxEmptyString;
290
sentencia << wxT("CREATE Index file_series ");
291
sentencia << wxT("ON File(pk, series_fk);");
292
dataBase.ExecuteUpdate(sentencia);
294
sentencia = wxEmptyString;
295
sentencia << wxT("CREATE Index file_location ");
296
sentencia << wxT("ON File(series_fk, location);");
297
dataBase.ExecuteUpdate(sentencia);
275
300
sentencia = wxEmptyString;