~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to install/createTables.sql

  • Committer: V. Keith Hughitt
  • Date: 2008-07-09 18:59:47 UTC
  • Revision ID: hughitt1@kore-20080709185947-lsdp2jwnuc1bs5nd
nightly build 07-09-2008: re-writing db population script to fix errors during tile processing

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- HelioViewer Database Structure --
 
2
-- last update: 06-25-2008        --
 
3
 
 
4
--
 
5
-- Create schema esahelio_svdb0
 
6
--
 
7
CREATE DATABASE IF NOT EXISTS esahelio_svdb0;
 
8
USE esahelio_svdb0;
 
9
 
 
10
--
 
11
-- Create tables
 
12
--
 
13
 
 
14
--
 
15
-- Table structure for table `image`
 
16
--
 
17
CREATE TABLE  `esahelio_svdb0`.`image` (
 
18
  `id` int(10) unsigned NOT NULL auto_increment,
 
19
  `measurementId` int(10) unsigned NOT NULL default '0',
 
20
  `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
 
21
  `filetype` varchar(4) default NULL,
 
22
  PRIMARY KEY  (`id`)
 
23
) ENGINE=MyISAM AUTO_INCREMENT=9198 DEFAULT CHARSET=utf8;
 
24
 
 
25
--
 
26
-- Table structure for table `tile`
 
27
--
 
28
DROP TABLE IF EXISTS `tile`;
 
29
CREATE TABLE IF NOT EXISTS `tile` (
 
30
  `imageId` int(11) NOT NULL default '0',
 
31
  `x` int(11) NOT NULL default '0',
 
32
  `y` int(11) NOT NULL default '0',
 
33
  `zoom` int(11) NOT NULL default '0',
 
34
  `url` varchar(255) default NULL,
 
35
  `tile` blob,
 
36
  PRIMARY KEY  (`imageId`,`x`,`y`,`zoom`)
 
37
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
38
 
 
39
 
 
40
CREATE TABLE `detector` (
 
41
  `id` int(10) unsigned NOT NULL auto_increment,
 
42
  `abbreviation` varchar(4) NOT NULL default '',
 
43
  `name` varchar(255) default NULL,
 
44
  `instrumentId` int(10) unsigned NOT NULL default '0',
 
45
  `imgSunRatio` float(6,3) default NULL,
 
46
  `lowestRegularZoomLevel` tinyint(4) default NULL,
 
47
  `opacityGroupId` int(10) unsigned NOT NULL default '1',
 
48
  PRIMARY KEY  (`id`)
 
49
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
 
50
 
 
51
--
 
52
-- Dumping data for table `detector`
 
53
--
 
54
 
 
55
INSERT INTO `detector` VALUES(11, 'MDI', 'MDI', 8, NULL, NULL, 1);
 
56
INSERT INTO `detector` VALUES(12, '0C3', '0C3', 9, NULL, NULL, 3);
 
57
INSERT INTO `detector` VALUES(13, '0C2', '0C2', 9, NULL, NULL, 2);
 
58
INSERT INTO `detector` VALUES(14, 'EIT', 'EIT', 10, NULL, NULL, 1);
 
59
 
 
60
-- --------------------------------------------------------
 
61
 
 
62
--
 
63
-- Table structure for table `instrument`
 
64
--
 
65
 
 
66
CREATE TABLE `instrument` (
 
67
  `id` int(10) unsigned NOT NULL auto_increment,
 
68
  `abbreviation` varchar(4) NOT NULL default '',
 
69
  `name` varchar(255) default NULL,
 
70
  `observatoryId` int(10) unsigned NOT NULL default '0',
 
71
  PRIMARY KEY  (`id`)
 
72
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
 
73
 
 
74
--
 
75
-- Dumping data for table `instrument`
 
76
--
 
77
 
 
78
INSERT INTO `instrument` VALUES(8, 'MDI', 'MDI', 3);
 
79
INSERT INTO `instrument` VALUES(9, 'LAS', 'LAS', 3);
 
80
INSERT INTO `instrument` VALUES(10, 'EIT', 'EIT', 3);
 
81
 
 
82
-- --------------------------------------------------------
 
83
 
 
84
--
 
85
-- Table structure for table `measurement`
 
86
--
 
87
 
 
88
CREATE TABLE `measurement` (
 
89
  `id` int(10) unsigned NOT NULL auto_increment,
 
90
  `measurementTypeId` int(10) unsigned NOT NULL default '0',
 
91
  `detectorId` int(10) unsigned NOT NULL default '0',
 
92
  `name` varchar(255) default NULL,
 
93
  `abbreviation` varchar(4) NOT NULL default '',
 
94
  PRIMARY KEY  (`id`)
 
95
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ;
 
96
 
 
97
--
 
98
-- Dumping data for table `measurement`
 
99
--
 
100
 
 
101
INSERT INTO `measurement` VALUES(17, 0, 11, 'mag', 'mag');
 
102
INSERT INTO `measurement` VALUES(18, 0, 11, 'int', 'int');
 
103
INSERT INTO `measurement` VALUES(19, 0, 12, '0WL', '0WL');
 
104
INSERT INTO `measurement` VALUES(20, 0, 13, '0WL', '0WL');
 
105
INSERT INTO `measurement` VALUES(21, 1, 14, '195', '195');
 
106
INSERT INTO `measurement` VALUES(22, 1, 14, '171', '171');
 
107
INSERT INTO `measurement` VALUES(23, 1, 14, '304', '304');
 
108
INSERT INTO `measurement` VALUES(24, 1, 14, '284', '284');
 
109
 
 
110
-- --------------------------------------------------------
 
111
 
 
112
--
 
113
-- Table structure for table `measurementType`
 
114
--
 
115
 
 
116
CREATE TABLE `measurementType` (
 
117
  `id` int(10) unsigned NOT NULL auto_increment,
 
118
  `name` varchar(255) NOT NULL default '',
 
119
  `unit` varchar(255) default NULL,
 
120
  PRIMARY KEY  (`id`)
 
121
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
 
122
 
 
123
--
 
124
-- Dumping data for table `measurementType`
 
125
--
 
126
 
 
127
INSERT INTO `measurementType` VALUES(0, 'measurement', NULL);
 
128
INSERT INTO `measurementType` VALUES(1, 'wavelength', 'nm');
 
129
 
 
130
-- --------------------------------------------------------
 
131
 
 
132
--
 
133
-- Table structure for table `observatory`
 
134
--
 
135
 
 
136
CREATE TABLE `observatory` (
 
137
  `id` int(10) unsigned NOT NULL auto_increment,
 
138
  `abbreviation` varchar(4) NOT NULL default '',
 
139
  `name` varchar(255) default NULL,
 
140
  PRIMARY KEY  (`id`)
 
141
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
 
142
 
 
143
--
 
144
-- Dumping data for table `observatory`
 
145
--
 
146
 
 
147
INSERT INTO `observatory` VALUES(3, 'soho', 'soho');
 
148
 
 
149
-- --------------------------------------------------------
 
150
 
 
151
--
 
152
-- Table structure for table `opacityGroup`
 
153
--
 
154
 
 
155
CREATE TABLE `opacityGroup` (
 
156
  `id` int(10) unsigned NOT NULL auto_increment,
 
157
  `description` varchar(255) NOT NULL,
 
158
  PRIMARY KEY  (`id`)
 
159
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
 
160
 
 
161
--
 
162
-- Dumping data for table `opacityGroup`
 
163
--
 
164
 
 
165
INSERT INTO `opacityGroup` VALUES(1, 'Full Disc Image');
 
166
INSERT INTO `opacityGroup` VALUES(2, 'Coronagraph Image, in the range of LASCO C2');
 
167
INSERT INTO `opacityGroup` VALUES(3, 'Coronagraph Image, in the range of LASCO C3');