· 9 years ago · Oct 15, 2016, 11:56 PM
1Operation failed: There was an error while applying the SQL script to the database.
2Executing:
3INSERT INTO `local`.`tab_evento` (`id`) VALUES ('18446744073709551616');
4
5ERROR 1264: 1264: Out of range value for column 'id' at row 1
6SQL Statement:
7INSERT INTO `local`.`tab_evento` (`id`) VALUES ('18446744073709551616')
8
9-- --------------------------------------------------------
10
11--
12-- Table structure for table `tab_confere_evento`
13--
14
15CREATE TABLE IF NOT EXISTS `tab_confere_evento` (
16`id` bigint(11) NOT NULL,
17 `evento_id` bigint(11) unsigned DEFAULT NULL,
18 `evento_periodo` int(10) unsigned NOT NULL,
19 `usuario` varchar(100) DEFAULT NULL,
20 `status` int(11) DEFAULT NULL
21) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
22
23-- --------------------------------------------------------
24
25--
26-- Table structure for table `tab_evento`
27--
28
29CREATE TABLE IF NOT EXISTS `tab_evento` (
30`id` bigint(20) unsigned NOT NULL,
31 `periodo` int(10) unsigned NOT NULL,
32 `data` timestamp NULL DEFAULT NULL,
33 `evento` varchar(120) DEFAULT NULL
34) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tabela para guardar os logs de modulos abertos pelo usuário' ;
35
36--
37-- Triggers `tab_evento`
38--
39DELIMITER //
40CREATE TRIGGER `prx_periodo_trigger` BEFORE INSERT ON `tab_evento`
41 FOR EACH ROW begin
42 set new.id=(select ifnull((select max(prx_id)+1 from tab_event where periodo=new.periodo),1));
43end
44//
45DELIMITER ;
46
47--
48-- Indexes for table `tab_confere_evento`
49--
50ALTER TABLE `tab_confere_evento`
51 ADD PRIMARY KEY (`id`,`evento_periodo`), ADD KEY `idx_evento_id` (`evento_id`,`evento_periodo`);
52
53--
54-- Indexes for table `tab_evento`
55--
56ALTER TABLE `tab_evento`
57 ADD PRIMARY KEY (`id`,`periodo`), ADD KEY `id` (`id`), ADD KEY `periodo` (`periodo`);