source: trunk/install/sql/eleonline.sql@ 404

Last change on this file since 404 was 394, checked in by roby, 18 months ago

-- ADMIN

  • Inserito il controllo per la gestione del caso di sezione con zero votanti

-- CLIENT

  • Inserito il controllo della dimensione del logo
  • Ulteriori modifiche all'assegnazione dei seggi secondo la legge siciliana
File size: 25.4 KB
RevLine 
[270]1SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
2START TRANSACTION;
3SET time_zone = "+00:00";
[2]4
[270]5/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
6/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
7/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
8/*!40101 SET NAMES utf8mb4 */;
9
[394]10CREATE DATABASE IF NOT EXISTS `eleonline` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
11USE `eleonline`;
[2]12
13CREATE TABLE `soraldo_access` (
14 `access_id` int(10) NOT NULL,
[270]15 `access_title` varchar(20) DEFAULT NULL
[394]16) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]17
[270]18INSERT INTO `soraldo_access` (`access_id`, `access_title`) VALUES
19(1, 'Sospeso'),
20(16, 'Operatore'),
21(32, 'Amministratore'),
22(64, 'Amministratore Unico'),
23(256, 'Superuser');
[2]24
25CREATE TABLE `soraldo_authors` (
[270]26 `aid` varchar(25) NOT NULL DEFAULT '',
27 `name` varchar(50) DEFAULT NULL,
[360]28 `id_comune` int(11) NOT NULL DEFAULT 0,
[270]29 `email` varchar(255) DEFAULT NULL,
30 `pwd` varchar(40) DEFAULT NULL,
[360]31 `counter` int(11) NOT NULL DEFAULT 0,
32 `adminop` tinyint(2) NOT NULL DEFAULT 0,
33 `admincomune` tinyint(2) NOT NULL DEFAULT 0,
34 `adminsuper` tinyint(2) NOT NULL DEFAULT 0,
[270]35 `admlanguage` varchar(30) NOT NULL DEFAULT ''
[394]36) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]37
[270]38INSERT INTO `soraldo_authors` (`aid`, `name`, `id_comune`, `email`, `pwd`, `counter`, `adminop`, `admincomune`, `adminsuper`, `admlanguage`) VALUES
[394]39('suser', 'suser', 0, 'test@eleonline.it', '098f6bcd4621d373cade4e832627b4f6', 1, 0, 0, 1, 'it');
[2]40
41CREATE TABLE `soraldo_config` (
[270]42 `sitename` varchar(255) NOT NULL DEFAULT '',
43 `siteurl` varchar(255) NOT NULL DEFAULT '',
44 `site_logo` varchar(255) NOT NULL DEFAULT '',
45 `slogan` varchar(255) NOT NULL DEFAULT '',
46 `startdate` varchar(50) NOT NULL DEFAULT '',
47 `adminmail` varchar(255) NOT NULL DEFAULT '',
[360]48 `tema` varchar(25) NOT NULL DEFAULT '',
49 `foot` mediumtext NOT NULL,
50 `language` char(3) NOT NULL DEFAULT '',
51 `blocco` enum('0','1') NOT NULL DEFAULT '0',
52 `testata` blob DEFAULT NULL,
53 `nome_testata` varchar(50) NOT NULL DEFAULT '',
54 `fileout` varchar(255) NOT NULL DEFAULT '',
55 `copyright` mediumtext NOT NULL,
56 `versione` int(3) DEFAULT NULL,
57 `patch` int(3) NOT NULL DEFAULT 0,
58 `siteistat` int(11) NOT NULL DEFAULT 0,
59 `multicomune` enum('0','1') NOT NULL DEFAULT '0',
60 `flash` enum('0','1') NOT NULL DEFAULT '0',
61 `displayerrors` enum('0','1') NOT NULL DEFAULT '0',
62 `gkey` varchar(100) NOT NULL DEFAULT '',
63 `googlemaps` enum('0','1') NOT NULL DEFAULT '0',
[270]64 `editor` enum('0','1') NOT NULL DEFAULT '1',
65 `tema_on` enum('0','1') NOT NULL DEFAULT '1',
[362]66 `ed_user` varchar(25) NOT NULL DEFAULT ''
[394]67) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]68
[394]69INSERT INTO `soraldo_config` (`sitename`, `siteurl`, `site_logo`, `slogan`, `startdate`, `adminmail`, `tema`, `foot`, `language`, `blocco`, `testata`, `nome_testata`, `fileout`, `copyright`, `versione`, `patch`, `siteistat`, `multicomune`, `flash`, `displayerrors`, `gkey`, `googlemaps`, `editor`, `tema_on`, `ed_user`) VALUES
70('Elezioni On Line', 'http://localhost/ele3/trunk/client', '', 'Sito istituzionale', 'March 2023', 'test@eleonline.it', 'default', '', 'it', '1', '', '', '', 'Gpl v3', 3, 0, 58047, '0', '0', '0', '', '0', '1', '1', 'Admin');
[2]71
72CREATE TABLE `soraldo_doc_cons` (
[360]73 `id_cons` int(11) NOT NULL DEFAULT 0,
74 `id_doc` int(11) NOT NULL DEFAULT 0,
75 `tabella` varchar(25) NOT NULL DEFAULT ''
[394]76) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]77
78CREATE TABLE `soraldo_ele_candidati` (
[270]79 `id_cand` int(11) NOT NULL,
[360]80 `id_cons` int(11) NOT NULL DEFAULT 0,
81 `id_lista` int(11) NOT NULL DEFAULT 0,
82 `num_lista` int(2) UNSIGNED NOT NULL,
[270]83 `cognome` varchar(50) DEFAULT NULL,
84 `nome` varchar(50) DEFAULT NULL,
[360]85 `note` text NOT NULL,
[270]86 `simbolo` varchar(30) NOT NULL DEFAULT '',
[360]87 `num_cand` int(7) NOT NULL DEFAULT 0
[394]88) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]89
90CREATE TABLE `soraldo_ele_circoscrizione` (
[360]91 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]92 `id_circ` int(11) NOT NULL,
[360]93 `num_circ` int(7) NOT NULL DEFAULT 0,
94 `descrizione` mediumtext DEFAULT NULL
[394]95) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]96
97CREATE TABLE `soraldo_ele_collegi` (
[270]98 `id_collegio` int(11) NOT NULL,
[360]99 `id_cons_gen` int(11) NOT NULL DEFAULT 0,
100 `descrizione` mediumtext DEFAULT NULL
[394]101) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]102
103CREATE TABLE `soraldo_ele_come` (
[360]104 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]105 `mid` int(7) NOT NULL,
[394]106 `title` varchar(150) NOT NULL DEFAULT ' ',
107 `preamble` text DEFAULT NULL,
108 `content` text DEFAULT NULL,
109 `editimage` varchar(100) NOT NULL DEFAULT ' '
110) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]111
112CREATE TABLE `soraldo_ele_comuni` (
[360]113 `id_comune` int(11) NOT NULL DEFAULT 0,
[270]114 `descrizione` varchar(50) DEFAULT NULL,
115 `indirizzo` varchar(50) DEFAULT NULL,
116 `centralino` varchar(15) DEFAULT NULL,
117 `fax` varchar(15) DEFAULT NULL,
118 `email` varchar(50) DEFAULT NULL,
[360]119 `fascia` tinyint(4) NOT NULL DEFAULT 0,
[270]120 `capoluogo` enum('0','1') NOT NULL DEFAULT '0',
[360]121 `simbolo` mediumtext DEFAULT NULL,
122 `stemma` blob DEFAULT NULL,
123 `id_cons` int(11) DEFAULT 0,
124 `cap` mediumtext DEFAULT NULL
[394]125) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]126
[394]127INSERT INTO `soraldo_ele_comuni` (`id_comune`, `descrizione`, `indirizzo`, `centralino`, `fax`, `email`, `fascia`, `capoluogo`, `simbolo`, `stemma`, `id_cons`, `cap`) VALUES
128(58047, 'Guidonia', '', '', '', '', 5, '0', '', '', 0, '');
[270]129
130CREATE TABLE `soraldo_ele_comu_collegi` (
[360]131 `id_collegio` int(11) NOT NULL DEFAULT 0,
132 `id_cons` int(11) NOT NULL DEFAULT 0,
133 `id_comune` int(11) NOT NULL DEFAULT 0,
134 `id_cons_gen` int(11) NOT NULL DEFAULT 0
[394]135) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]136
137CREATE TABLE `soraldo_ele_conf` (
[270]138 `id_conf` int(11) NOT NULL,
[2]139 `descrizione` varchar(50) NOT NULL,
140 `limite` int(2) NOT NULL,
[189]141 `consin` enum('0','1') NOT NULL DEFAULT '1',
[2]142 `infpremio` int(3) NOT NULL,
143 `supsbarramento` int(3) NOT NULL,
144 `suppremio` int(3) NOT NULL,
[360]145 `listinfsbar` int(3) NOT NULL DEFAULT 1,
[189]146 `listinfconta` enum('0','1') NOT NULL DEFAULT '1',
147 `listsupconta` enum('0','1') NOT NULL DEFAULT '1',
[2]148 `supminpremio` int(3) NOT NULL,
149 `infminpremio` int(3) NOT NULL,
[139]150 `infdisgiunto` enum('0','1') NOT NULL DEFAULT '0',
151 `supdisgiunto` enum('0','1') NOT NULL DEFAULT '0',
[189]152 `votolista` enum('0','1') NOT NULL DEFAULT '0',
153 `inffisso` enum('0','1') NOT NULL DEFAULT '0',
154 `supfisso` enum('0','1') NOT NULL DEFAULT '0',
[360]155 `fascia_capoluogo` int(2) NOT NULL DEFAULT 0
[394]156) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]157
[189]158INSERT INTO `soraldo_ele_conf` (`id_conf`, `descrizione`, `limite`, `consin`, `infpremio`, `supsbarramento`, `suppremio`, `listinfsbar`, `listinfconta`, `listsupconta`, `supminpremio`, `infminpremio`, `infdisgiunto`, `supdisgiunto`, `votolista`, `inffisso`, `supfisso`, `fascia_capoluogo`) VALUES
159(1, 'Legge Italiana 267/2000', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6),
160(2, 'Regione Sicilia precedente al 2008', 2, '0', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6),
161(3, 'Regione Sicilia Legge n. 22 del 16/12/2008', 2, '0', 67, 5, 60, 3, '1', '0', 40, 40, '0', '0', '0', '0', '0', 7),
[394]162(4, 'Regione Sicilia Legge n.6/2011', 5, '1', 67, 5, 60, 5, '1', '1', 40, 40, '1', '1', '0', '1', '0', 7),
[189]163(5, 'Legge Italiana 267/2000 con riduzione 2011', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
[201]164(6, 'Legge Italiana 267/2000 con riduzione 2012', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
[199]165(7, 'Legge Italiana 267/2000 con modifiche 2014', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6);
[2]166
[270]167CREATE TABLE `soraldo_ele_consultazione` (
168 `id_cons_gen` int(11) NOT NULL,
[360]169 `descrizione` mediumtext DEFAULT NULL,
[270]170 `data_inizio` date DEFAULT NULL,
171 `data_fine` date DEFAULT NULL,
[360]172 `tipo_cons` int(7) NOT NULL DEFAULT 0
[394]173) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]174
[270]175CREATE TABLE `soraldo_ele_cons_comune` (
176 `id_cons` int(11) NOT NULL,
177 `chiusa` set('0','1','2') NOT NULL DEFAULT '0',
[360]178 `id_comune` int(11) NOT NULL DEFAULT 0,
179 `id_cons_gen` int(11) NOT NULL DEFAULT 0,
180 `id_conf` int(11) NOT NULL DEFAULT 0,
[270]181 `preferita` enum('0','1') NOT NULL DEFAULT '0',
[360]182 `preferenze` tinyint(1) NOT NULL DEFAULT 1,
183 `id_fascia` int(2) NOT NULL DEFAULT 1,
[270]184 `vismf` enum('0','1') NOT NULL DEFAULT '0',
[360]185 `solo_gruppo` enum('0','1') DEFAULT '0',
[270]186 `disgiunto` enum('0','1') NOT NULL DEFAULT '0'
[394]187) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]188
[270]189CREATE TABLE `soraldo_ele_controlli` (
190 `id_cons` int(11) NOT NULL,
191 `id_sez` int(11) NOT NULL,
192 `tipo` varchar(10) NOT NULL,
193 `id` int(11) NOT NULL
[394]194) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]195
196CREATE TABLE `soraldo_ele_documenti` (
[270]197 `id_doc` int(11) NOT NULL,
[360]198 `descrizione` varchar(50) NOT NULL DEFAULT '',
199 `nomedoc` varchar(25) NOT NULL DEFAULT '',
[270]200 `filedoc` blob NOT NULL
[394]201) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]202
203CREATE TABLE `soraldo_ele_fasce` (
204 `id_fascia` int(2) NOT NULL,
205 `abitanti` int(11) NOT NULL,
206 `seggi` int(4) NOT NULL,
[360]207 `id_conf` int(11) DEFAULT 1
[394]208) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]209
[270]210INSERT INTO `soraldo_ele_fasce` (`id_fascia`, `abitanti`, `seggi`, `id_conf`) VALUES
[189]211(1, 3000, 12, 1),
212(2, 10000, 16, 1),
213(3, 15000, 20, 1),
214(4, 30000, 20, 1),
215(5, 100000, 30, 1),
216(6, 250000, 40, 1),
217(7, 500000, 46, 1),
218(8, 1000000, 50, 1),
219(9, 100000000, 60, 1),
220(1, 3000, 12, 2),
221(2, 10000, 16, 2),
222(3, 15000, 20, 2),
223(4, 30000, 20, 2),
224(5, 100000, 30, 2),
225(6, 250000, 40, 2),
226(7, 500000, 46, 2),
227(8, 1000000, 50, 2),
228(9, 100000000, 60, 2),
229(1, 3000, 9, 3),
230(2, 5000, 9, 3),
231(4, 15000, 16, 3),
232(3, 10000, 12, 3),
233(5, 30000, 16, 3),
234(6, 100000, 24, 3),
235(7, 250000, 32, 3),
236(8, 500000, 36, 3),
237(9, 1000000, 40, 3),
238(10, 100000000, 48, 3),
239(1, 3000, 6, 4),
240(2, 5000, 7, 4),
241(3, 10000, 12, 4),
242(4, 15000, 16, 4),
243(5, 30000, 16, 4),
244(6, 100000, 24, 4),
245(7, 250000, 32, 4),
246(8, 500000, 36, 4),
247(9, 1000000, 40, 4),
[199]248(10, 100000000, 48, 4),
249(1, 3000, 9, 5),
250(2, 5000, 9, 5),
251(3, 10000, 12, 5),
252(4, 15000, 16, 5),
253(5, 30000, 16, 5),
254(6, 100000, 24, 5),
255(7, 250000, 32, 5),
256(8, 500000, 36, 5),
257(9, 1000000, 40, 5),
258(10, 100000000, 48, 5),
259(1, 3000, 6, 6),
260(2, 5000, 7, 6),
261(3, 10000, 10, 6),
262(4, 15000, 16, 6),
263(5, 30000, 16, 6),
264(6, 100000, 24, 6),
265(7, 250000, 32, 6),
266(8, 500000, 36, 6),
267(9, 1000000, 40, 6),
268(10, 100000000, 48, 6),
269(1, 3000, 10, 7),
270(2, 10000, 12, 7),
271(3, 15000, 16, 7),
272(4, 30000, 16, 7),
273(5, 100000, 24, 7),
274(6, 250000, 32, 7),
275(7, 500000, 36, 7),
276(8, 1000000, 40, 7),
277(9, 100000000, 48, 7);
[2]278
279CREATE TABLE `soraldo_ele_gruppo` (
[360]280 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]281 `id_gruppo` int(11) NOT NULL,
[360]282 `num_gruppo` int(7) NOT NULL DEFAULT 0,
283 `descrizione` mediumtext DEFAULT NULL,
284 `simbolo` mediumtext DEFAULT NULL,
285 `stemma` blob DEFAULT NULL,
286 `id_circ` int(11) NOT NULL DEFAULT 0,
287 `num_circ` int(2) UNSIGNED NOT NULL DEFAULT 1,
288 `prognome` mediumtext DEFAULT NULL,
289 `programma` mediumblob DEFAULT NULL
[394]290) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]291
[270]292CREATE TABLE `soraldo_ele_link` (
[360]293 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]294 `mid` int(7) NOT NULL,
[394]295 `title` varchar(150) NOT NULL DEFAULT ' ',
296 `preamble` text DEFAULT NULL,
297 `content` text DEFAULT NULL,
298 `editimage` varchar(100) NOT NULL DEFAULT ' '
299) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]300
[270]301CREATE TABLE `soraldo_ele_lista` (
[360]302 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]303 `id_lista` int(11) NOT NULL,
[360]304 `num_lista` int(7) NOT NULL DEFAULT 0,
305 `id_gruppo` int(11) NOT NULL DEFAULT 0,
306 `num_gruppo` int(2) UNSIGNED NOT NULL DEFAULT 0,
307 `id_circ` int(11) NOT NULL DEFAULT 0,
308 `num_circ` int(2) UNSIGNED NOT NULL DEFAULT 1,
309 `descrizione` text DEFAULT NULL,
310 `simbolo` mediumtext DEFAULT NULL,
311 `stemma` blob DEFAULT NULL
[394]312) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]313
[270]314CREATE TABLE `soraldo_ele_log` (
315 `id_cons` int(11) DEFAULT NULL,
316 `id_sez` int(11) DEFAULT NULL,
317 `utente` varchar(20) DEFAULT NULL,
318 `data` date DEFAULT NULL,
319 `ora` time DEFAULT NULL,
[360]320 `log_da` mediumtext DEFAULT NULL,
321 `log_a` mediumtext DEFAULT NULL,
[270]322 `tabella` varchar(30) DEFAULT NULL
[394]323) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]324
[270]325CREATE TABLE `soraldo_ele_modelli` (
[360]326 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]327 `categoria` varchar(20) NOT NULL DEFAULT '',
328 `modello` blob NOT NULL
[394]329) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]330
[270]331CREATE TABLE `soraldo_ele_numeri` (
[360]332 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]333 `mid` int(7) NOT NULL,
334 `title` varchar(150) NOT NULL DEFAULT '',
[360]335 `preamble` mediumtext NOT NULL,
336 `content` mediumtext NOT NULL,
[270]337 `editimage` varchar(100) NOT NULL DEFAULT ''
[394]338) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]339
[270]340CREATE TABLE `soraldo_ele_operatori` (
[360]341 `id_cons` int(11) NOT NULL DEFAULT 0,
342 `id_sede` int(11) NOT NULL DEFAULT 0,
343 `id_comune` int(11) NOT NULL DEFAULT 0,
[270]344 `permessi` int(3) DEFAULT NULL,
[360]345 `aid` varchar(25) NOT NULL DEFAULT '',
346 `id_circ` int(11) NOT NULL DEFAULT 0,
347 `id_sez` int(11) NOT NULL DEFAULT 0
[394]348) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]349
[270]350CREATE TABLE `soraldo_ele_province` (
[360]351 `id` tinyint(11) NOT NULL DEFAULT 0,
352 `descrizione` varchar(30) NOT NULL DEFAULT ''
[394]353) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]354
[270]355CREATE TABLE `soraldo_ele_regioni` (
[360]356 `id` int(11) NOT NULL DEFAULT 0,
357 `descrizione` varchar(25) NOT NULL DEFAULT ''
[394]358) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]359
[270]360CREATE TABLE `soraldo_ele_rilaff` (
[360]361 `id_cons_gen` int(11) NOT NULL DEFAULT 0,
[270]362 `orario` time NOT NULL DEFAULT '00:00:00',
[394]363 `data` date NOT NULL DEFAULT '1900-01-01'
364) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]365
[270]366CREATE TABLE `soraldo_ele_sede` (
[360]367 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]368 `id_sede` int(11) NOT NULL,
[360]369 `id_circ` int(11) NOT NULL DEFAULT 0,
[270]370 `indirizzo` varchar(60) DEFAULT NULL,
371 `telefono1` varchar(12) DEFAULT NULL,
372 `telefono2` varchar(12) DEFAULT NULL,
373 `fax` varchar(12) DEFAULT NULL,
374 `responsabile` varchar(60) DEFAULT NULL,
375 `mappa` mediumblob NOT NULL,
376 `filemappa` varchar(100) NOT NULL DEFAULT ''
[394]377) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[270]378
379CREATE TABLE `soraldo_ele_servizi` (
[360]380 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]381 `mid` int(7) NOT NULL,
[394]382 `title` varchar(150) NOT NULL DEFAULT ' ',
383 `preamble` text DEFAULT NULL,
384 `content` text DEFAULT NULL,
385 `editimage` varchar(100) NOT NULL DEFAULT ' '
386) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]387
[270]388CREATE TABLE `soraldo_ele_sezioni` (
[360]389 `id_cons` int(11) NOT NULL DEFAULT 0,
[270]390 `id_sez` int(11) NOT NULL,
[360]391 `id_sede` int(11) NOT NULL DEFAULT 0,
392 `num_sez` int(7) NOT NULL DEFAULT 0,
[270]393 `maschi` int(4) DEFAULT NULL,
394 `femmine` int(4) DEFAULT NULL,
[360]395 `validi` int(7) NOT NULL DEFAULT 0,
396 `nulli` int(7) NOT NULL DEFAULT 0,
397 `bianchi` int(7) NOT NULL DEFAULT 0,
398 `contestati` int(7) NOT NULL DEFAULT 0,
399 `solo_gruppo` int(7) NOT NULL DEFAULT 0,
400 `autorizzati_m` int(4) NOT NULL DEFAULT 0,
401 `autorizzati_f` int(4) NOT NULL DEFAULT 0,
402 `voti_nulli` int(7) NOT NULL DEFAULT 0,
403 `validi_lista` int(7) NOT NULL DEFAULT 0,
404 `contestati_lista` int(7) NOT NULL DEFAULT 0,
405 `voti_nulli_lista` int(7) NOT NULL DEFAULT 0,
406 `solo_lista` int(7) NOT NULL DEFAULT 0,
[394]407 `colore` varchar(50) DEFAULT '#FAFAD2'
408) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]409
[270]410CREATE TABLE `soraldo_ele_temi` (
411 `id` int(11) NOT NULL,
412 `tema` varchar(20) NOT NULL DEFAULT ''
[394]413) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]414
[270]415CREATE TABLE `soraldo_ele_tipo` (
[360]416 `tipo_cons` int(11) NOT NULL DEFAULT 0,
[270]417 `descrizione` varchar(30) DEFAULT NULL,
418 `lingua` varchar(2) NOT NULL DEFAULT '0',
[360]419 `genere` tinyint(4) NOT NULL DEFAULT 0,
[270]420 `voto_g` enum('0','1') NOT NULL DEFAULT '0',
421 `voto_l` enum('0','1') NOT NULL DEFAULT '0',
422 `voto_c` enum('0','1') NOT NULL DEFAULT '0',
423 `circo` enum('0','1') NOT NULL DEFAULT '0'
[394]424) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]425
[270]426INSERT INTO `soraldo_ele_tipo` (`tipo_cons`, `descrizione`, `lingua`, `genere`, `voto_g`, `voto_l`, `voto_c`, `circo`) VALUES
427(1, 'PROVINCIALI', 'it', 3, '0', '0', '0', '0'),
428(2, 'REFERENDUM', 'it', 0, '0', '0', '0', '0'),
429(3, 'COMUNALI', 'it', 5, '0', '0', '0', '0'),
430(4, 'CIRCOSCRIZIONALI', 'it', 5, '0', '0', '0', '1'),
431(5, 'BALLOTTAGGIO COMUNALI', 'it', 1, '0', '0', '0', '0'),
432(6, 'CAMERA', 'it', 2, '0', '0', '0', '0'),
433(7, 'SENATO', 'it', 2, '0', '0', '0', '0'),
[354]434(8, 'EUROPEE', 'it', 4, '0', '0', '0', '0'),
[270]435(9, 'REGIONALI', 'it', 5, '0', '0', '0', '0'),
436(10, 'SENATO CON GRUPPI', 'it', 5, '1', '0', '1', '0'),
437(11, 'CAMERA CON GRUPPI', 'it', 5, '1', '0', '1', '0'),
438(12, 'PROVINCIALI CON COLLEGI', 'it', 3, '0', '0', '0', '1'),
439(13, 'BALLOTTAGGIO PROVINCIALI', 'it', 1, '0', '0', '0', '0'),
440(14, 'EUROPEE CON COLLEGI', 'it', 4, '0', '0', '0', '1'),
441(15, 'CAMERA CON GRUPPI E COLLEGI', 'it', 5, '1', '0', '1', '1'),
442(16, 'SENATO CON GRUPPI E COLLEGI', 'it', 5, '1', '0', '1', '1'),
443(17, 'REGIONALI CON COLLEGI', 'it', 5, '0', '0', '0', '1'),
444(18, 'CAMERA - Rosatellum 2.0', 'it', 5, '0', '0', '1', '0'),
445(19, 'SENATO - Rosatellum 2.0', 'it', 5, '0', '0', '1', '0');
446
447CREATE TABLE `soraldo_ele_voti_candidati` (
[360]448 `id_cons` int(11) NOT NULL DEFAULT 0,
449 `id_cand` int(11) NOT NULL DEFAULT 0,
450 `id_sez` int(11) NOT NULL DEFAULT 0,
[270]451 `num_cand` int(2) UNSIGNED NOT NULL,
[360]452 `voti` int(7) NOT NULL DEFAULT 0
[394]453) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]454
[270]455CREATE TABLE `soraldo_ele_voti_gruppo` (
[360]456 `id_cons` int(11) NOT NULL DEFAULT 0,
457 `id_gruppo` int(11) NOT NULL DEFAULT 0,
458 `id_sez` int(11) NOT NULL DEFAULT 0,
[270]459 `num_gruppo` int(2) UNSIGNED NOT NULL,
[360]460 `voti` int(7) NOT NULL DEFAULT 0,
461 `solo_gruppo` int(7) NOT NULL DEFAULT 0
[394]462) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]463
[270]464CREATE TABLE `soraldo_ele_voti_lista` (
[360]465 `id_cons` int(11) NOT NULL DEFAULT 0,
466 `id_lista` int(11) NOT NULL DEFAULT 0,
467 `id_sez` int(11) NOT NULL DEFAULT 0,
468 `num_lista` int(2) UNSIGNED DEFAULT 0,
469 `voti` int(7) NOT NULL DEFAULT 0,
470 `nulli_lista` int(7) NOT NULL DEFAULT 0,
471 `solo_lista` int(7) DEFAULT 0
[394]472) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]473
[270]474CREATE TABLE `soraldo_ele_voti_parziale` (
[360]475 `id_cons` int(11) NOT NULL DEFAULT 0,
476 `id_sez` int(11) NOT NULL DEFAULT 0,
[270]477 `id_parz` int(11) NOT NULL,
478 `orario` time NOT NULL DEFAULT '00:00:00',
[394]479 `data` date NOT NULL DEFAULT '1900-01-01',
[360]480 `voti_uomini` int(7) NOT NULL DEFAULT 0,
481 `voti_donne` int(7) NOT NULL DEFAULT 0,
482 `voti_complessivi` int(7) NOT NULL DEFAULT 0,
483 `id_gruppo` int(11) NOT NULL DEFAULT 0
[394]484) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]485
[270]486CREATE TABLE `soraldo_ele_voti_ref` (
[360]487 `id_cons` int(11) NOT NULL DEFAULT 0,
488 `id_gruppo` int(11) NOT NULL DEFAULT 0,
489 `id_sez` int(11) NOT NULL DEFAULT 0,
[270]490 `num_gruppo` int(2) UNSIGNED NOT NULL,
[360]491 `si` int(7) DEFAULT 0,
492 `no` int(7) DEFAULT 0,
493 `validi` int(7) DEFAULT 0,
494 `nulli` int(7) DEFAULT 0,
495 `bianchi` int(7) DEFAULT 0,
496 `contestati` int(7) DEFAULT 0
[394]497) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]498
[270]499CREATE TABLE `soraldo_ele_widget` (
500 `id` int(10) NOT NULL,
501 `nome_file` varchar(255) NOT NULL DEFAULT '',
502 `titolo` varchar(255) NOT NULL DEFAULT '',
[360]503 `pos_or` int(1) NOT NULL DEFAULT 1,
504 `pos_ver` int(3) NOT NULL DEFAULT 0,
505 `attivo` int(1) NOT NULL DEFAULT 0
[394]506) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
[2]507
[270]508INSERT INTO `soraldo_ele_widget` (`id`, `nome_file`, `titolo`, `pos_or`, `pos_ver`, `attivo`) VALUES
509(1, '00_affluenze.php', '00_affluenze.php', 1, 0, 0),
510(2, '01_votanti.php', '01_votanti.php', 1, 0, 0),
511(3, '02_risultati.php', '02_risultati.php', 1, 0, 0),
512(4, '04_sezioni.php', '04_sezioni.php', 1, 0, 0),
[362]513(5, 'privacy.php', 'privacy.php', 1, 0, 0),
[270]514(6, 'bloccocand.php', 'bloccocand.php', 1, 0, 0),
515(7, 'bloccogen.php', 'bloccogen.php', 1, 0, 0),
516(8, 'bloccolink.php', 'bloccolink.php', 1, 0, 0),
517(9, 'bloccoref.php', 'bloccoref.php', 1, 0, 0),
518(10, 'gom_affluenze.php', 'gom_affluenze.php', 1, 0, 0),
[362]519(11, 'pie_affluenze.php', 'pie_affluenze.php', 1, 0, 0),
520(12, 'social.php', 'social.php', 1, 0, 0),
521(13, 'cerca_candidato.php', 'cerca_candidato.php', 1, 0, 0),
522(14, 'cookie_law.php', 'cookie_law.php', 1, 0, 0);
[270]523
[2]524
[270]525ALTER TABLE `soraldo_access`
526 ADD PRIMARY KEY (`access_id`);
[2]527
[270]528ALTER TABLE `soraldo_authors`
529 ADD PRIMARY KEY (`aid`,`id_comune`),
530 ADD KEY `aid` (`aid`);
[2]531
[270]532ALTER TABLE `soraldo_doc_cons`
533 ADD KEY `id_cons` (`id_cons`,`id_doc`);
[2]534
[270]535ALTER TABLE `soraldo_ele_candidati`
[360]536 ADD PRIMARY KEY (`id_cand`) USING BTREE,
[270]537 ADD KEY `id_lista` (`id_lista`),
[360]538 ADD KEY `id_cons` (`id_cons`,`id_lista`) USING BTREE;
[2]539
[270]540ALTER TABLE `soraldo_ele_circoscrizione`
541 ADD UNIQUE KEY `id_circ` (`id_circ`),
542 ADD UNIQUE KEY `id_cons` (`id_cons`,`num_circ`);
[2]543
[270]544ALTER TABLE `soraldo_ele_collegi`
545 ADD PRIMARY KEY (`id_collegio`),
546 ADD KEY `id_cons_gen` (`id_cons_gen`);
[2]547
[270]548ALTER TABLE `soraldo_ele_come`
549 ADD UNIQUE KEY `mid` (`mid`);
[2]550
[270]551ALTER TABLE `soraldo_ele_comuni`
552 ADD PRIMARY KEY (`id_comune`),
553 ADD KEY `access_id` (`descrizione`);
[2]554
[270]555ALTER TABLE `soraldo_ele_comu_collegi`
556 ADD PRIMARY KEY (`id_cons_gen`,`id_comune`),
557 ADD KEY `id_cons` (`id_cons`),
558 ADD KEY `id_collegio` (`id_collegio`);
[2]559
[270]560ALTER TABLE `soraldo_ele_conf`
561 ADD PRIMARY KEY (`id_conf`);
[2]562
[270]563ALTER TABLE `soraldo_ele_consultazione`
[360]564 ADD PRIMARY KEY (`id_cons_gen`),
565 ADD UNIQUE KEY `descrizione` (`descrizione`(100));
[2]566
[270]567ALTER TABLE `soraldo_ele_cons_comune`
568 ADD PRIMARY KEY (`id_cons`),
569 ADD UNIQUE KEY `comune` (`id_comune`,`id_cons_gen`);
[2]570
[270]571ALTER TABLE `soraldo_ele_controlli`
572 ADD KEY `sezione` (`id_sez`);
[2]573
[270]574ALTER TABLE `soraldo_ele_documenti`
575 ADD PRIMARY KEY (`id_doc`),
576 ADD KEY `descrizione` (`descrizione`);
[2]577
[270]578ALTER TABLE `soraldo_ele_fasce`
579 ADD KEY `id_fascia` (`id_fascia`);
[2]580
[270]581ALTER TABLE `soraldo_ele_gruppo`
[360]582 ADD PRIMARY KEY (`id_gruppo`) USING BTREE,
583 ADD KEY `id_cons` (`id_cons`,`id_circ`) USING BTREE;
[2]584
[270]585ALTER TABLE `soraldo_ele_link`
586 ADD PRIMARY KEY (`mid`);
[2]587
[270]588ALTER TABLE `soraldo_ele_lista`
[360]589 ADD PRIMARY KEY (`id_lista`) USING BTREE,
590 ADD KEY `id_gruppo` (`id_gruppo`),
591 ADD KEY `id_cons` (`id_cons`,`id_gruppo`) USING BTREE;
[2]592
[270]593ALTER TABLE `soraldo_ele_modelli`
594 ADD KEY `access_id` (`id_cons`);
[93]595
[270]596ALTER TABLE `soraldo_ele_numeri`
597 ADD PRIMARY KEY (`mid`),
598 ADD KEY `id_cons` (`id_cons`);
[93]599
[270]600ALTER TABLE `soraldo_ele_operatori`
601 ADD UNIQUE KEY `id_cons_aid` (`id_cons`,`aid`,`id_comune`),
602 ADD KEY `id_circ` (`id_comune`),
603 ADD KEY `id_sede` (`id_sede`);
[93]604
[270]605ALTER TABLE `soraldo_ele_regioni`
606 ADD PRIMARY KEY (`id`),
607 ADD KEY `descrizione` (`descrizione`);
[2]608
[270]609ALTER TABLE `soraldo_ele_rilaff`
610 ADD KEY `id_cons_gen` (`id_cons_gen`);
[2]611
[270]612ALTER TABLE `soraldo_ele_sede`
613 ADD PRIMARY KEY (`id_sede`),
614 ADD KEY `id_cons` (`id_cons`),
615 ADD KEY `id_circ` (`id_circ`);
[2]616
[270]617ALTER TABLE `soraldo_ele_servizi`
618 ADD PRIMARY KEY (`mid`),
619 ADD KEY `id_cons` (`id_cons`);
[2]620
[270]621ALTER TABLE `soraldo_ele_sezioni`
622 ADD UNIQUE KEY `id_sezi` (`id_sez`),
[394]623 ADD UNIQUE KEY `id_cons` (`id_cons`,`num_sez`) USING BTREE,
[270]624 ADD KEY `id_sede` (`id_sede`);
[2]625
[270]626ALTER TABLE `soraldo_ele_temi`
627 ADD PRIMARY KEY (`id`);
[2]628
[270]629ALTER TABLE `soraldo_ele_tipo`
630 ADD PRIMARY KEY (`tipo_cons`);
[2]631
[270]632ALTER TABLE `soraldo_ele_voti_candidati`
633 ADD KEY `id_sez` (`id_sez`),
634 ADD KEY `id_cand` (`id_cand`),
[360]635 ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_cand`) USING BTREE;
[2]636
[270]637ALTER TABLE `soraldo_ele_voti_gruppo`
638 ADD KEY `id_gruppo` (`id_gruppo`),
639 ADD KEY `id_sez` (`id_sez`),
[360]640 ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_gruppo`) USING BTREE;
[2]641
[270]642ALTER TABLE `soraldo_ele_voti_lista`
643 ADD KEY `id_lista` (`id_lista`),
644 ADD KEY `id_sez` (`id_sez`),
[360]645 ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_lista`) USING BTREE;
[2]646
[270]647ALTER TABLE `soraldo_ele_voti_parziale`
648 ADD PRIMARY KEY (`id_parz`),
649 ADD KEY `id_cons` (`id_cons`),
650 ADD KEY `id_sez` (`id_sez`),
651 ADD KEY `id_gruppo` (`id_gruppo`);
[2]652
[270]653ALTER TABLE `soraldo_ele_voti_ref`
654 ADD KEY `id_gruppo` (`id_gruppo`),
655 ADD KEY `id_sez` (`id_sez`),
[360]656 ADD KEY `id_cons` (`id_cons`,`id_gruppo`) USING BTREE;
[2]657
[270]658ALTER TABLE `soraldo_ele_widget`
659 ADD PRIMARY KEY (`id`);
[2]660
661
[270]662ALTER TABLE `soraldo_ele_candidati`
663 MODIFY `id_cand` int(11) NOT NULL AUTO_INCREMENT;
[2]664
[270]665ALTER TABLE `soraldo_ele_circoscrizione`
666 MODIFY `id_circ` int(11) NOT NULL AUTO_INCREMENT;
[2]667
[270]668ALTER TABLE `soraldo_ele_collegi`
669 MODIFY `id_collegio` int(11) NOT NULL AUTO_INCREMENT;
[2]670
[270]671ALTER TABLE `soraldo_ele_come`
672 MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
[2]673
[270]674ALTER TABLE `soraldo_ele_conf`
675 MODIFY `id_conf` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
[2]676
[270]677ALTER TABLE `soraldo_ele_consultazione`
678 MODIFY `id_cons_gen` int(11) NOT NULL AUTO_INCREMENT;
[2]679
[270]680ALTER TABLE `soraldo_ele_cons_comune`
681 MODIFY `id_cons` int(11) NOT NULL AUTO_INCREMENT;
[2]682
[270]683ALTER TABLE `soraldo_ele_documenti`
684 MODIFY `id_doc` int(11) NOT NULL AUTO_INCREMENT;
[2]685
[270]686ALTER TABLE `soraldo_ele_gruppo`
687 MODIFY `id_gruppo` int(11) NOT NULL AUTO_INCREMENT;
[2]688
[270]689ALTER TABLE `soraldo_ele_link`
690 MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
[2]691
[270]692ALTER TABLE `soraldo_ele_lista`
693 MODIFY `id_lista` int(11) NOT NULL AUTO_INCREMENT;
[2]694
[270]695ALTER TABLE `soraldo_ele_numeri`
696 MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
[77]697
[270]698ALTER TABLE `soraldo_ele_sede`
699 MODIFY `id_sede` int(11) NOT NULL AUTO_INCREMENT;
[77]700
[270]701ALTER TABLE `soraldo_ele_servizi`
702 MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
[77]703
[270]704ALTER TABLE `soraldo_ele_sezioni`
705 MODIFY `id_sez` int(11) NOT NULL AUTO_INCREMENT;
[77]706
[270]707ALTER TABLE `soraldo_ele_temi`
708 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
[77]709
[270]710ALTER TABLE `soraldo_ele_voti_parziale`
711 MODIFY `id_parz` int(11) NOT NULL AUTO_INCREMENT;
[77]712
[270]713ALTER TABLE `soraldo_ele_widget`
[394]714 MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
[270]715COMMIT;
[77]716
[270]717/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
718/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
719/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Note: See TracBrowser for help on using the repository browser.