Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- --------------------------------------------------------
- --
- -- Структура таблицы `gammu`
- --
- CREATE TABLE `gammu` (
- `Version` int(11) NOT NULL DEFAULT '0'
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- --
- -- Дамп данных таблицы `gammu`
- --
- INSERT INTO `gammu` (`Version`) VALUES
- (16);
- -- --------------------------------------------------------
- --
- -- Структура таблицы `inbox`
- --
- CREATE TABLE `inbox` (
- `UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `ReceivingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `Text` text NOT NULL,
- `SenderNumber` varchar(20) NOT NULL DEFAULT '',
- `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression',
- `UDH` text NOT NULL,
- `SMSCNumber` varchar(20) NOT NULL DEFAULT '',
- `Class` int(11) NOT NULL DEFAULT '-1',
- `TextDecoded` text NOT NULL,
- `ID` int(10) UNSIGNED NOT NULL,
- `RecipientID` text NOT NULL,
- `Processed` enum('false','true') NOT NULL DEFAULT 'false'
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- --
- -- Триггеры `inbox`
- --
- DELIMITER $$
- CREATE TRIGGER `inbox_timestamp` BEFORE INSERT ON `inbox` FOR EACH ROW BEGIN
- IF NEW.ReceivingDateTime = '0000-00-00 00:00:00' THEN
- SET NEW.ReceivingDateTime = CURRENT_TIMESTAMP();
- END IF;
- END
- $$
- DELIMITER ;
- -- --------------------------------------------------------
- --
- -- Структура таблицы `outbox`
- --
- CREATE TABLE `outbox` (
- `UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `SendingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `SendBefore` time NOT NULL DEFAULT '23:59:59',
- `SendAfter` time NOT NULL DEFAULT '00:00:00',
- `Text` text,
- `DestinationNumber` varchar(20) NOT NULL DEFAULT '',
- `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression',
- `UDH` text,
- `Class` int(11) DEFAULT '-1',
- `TextDecoded` text NOT NULL,
- `ID` int(10) UNSIGNED NOT NULL,
- `MultiPart` enum('false','true') DEFAULT 'false',
- `RelativeValidity` int(11) DEFAULT '-1',
- `SenderID` varchar(255) DEFAULT NULL,
- `SendingTimeOut` timestamp NULL DEFAULT '0000-00-00 00:00:00',
- `DeliveryReport` enum('default','yes','no') DEFAULT 'default',
- `CreatorID` text NOT NULL,
- `Retries` int(3) DEFAULT '0',
- `Priority` int(11) DEFAULT '0'
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- --
- -- Триггеры `outbox`
- --
- DELIMITER $$
- CREATE TRIGGER `outbox_timestamp` BEFORE INSERT ON `outbox` FOR EACH ROW BEGIN
- IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
- SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
- END IF;
- IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
- SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
- END IF;
- IF NEW.SendingTimeOut = '0000-00-00 00:00:00' THEN
- SET NEW.SendingTimeOut = CURRENT_TIMESTAMP();
- END IF;
- END
- $$
- DELIMITER ;
- -- --------------------------------------------------------
- --
- -- Структура таблицы `outbox_multipart`
- --
- CREATE TABLE `outbox_multipart` (
- `Text` text,
- `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression',
- `UDH` text,
- `Class` int(11) DEFAULT '-1',
- `TextDecoded` text,
- `ID` int(10) UNSIGNED NOT NULL DEFAULT '0',
- `SequencePosition` int(11) NOT NULL DEFAULT '1'
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- -- --------------------------------------------------------
- --
- -- Структура таблицы `phones`
- --
- CREATE TABLE `phones` (
- `ID` text NOT NULL,
- `UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `TimeOut` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `Send` enum('yes','no') NOT NULL DEFAULT 'no',
- `Receive` enum('yes','no') NOT NULL DEFAULT 'no',
- `IMEI` varchar(35) NOT NULL,
- `IMSI` varchar(35) NOT NULL,
- `NetCode` varchar(10) DEFAULT 'ERROR',
- `NetName` varchar(35) DEFAULT 'ERROR',
- `Client` text NOT NULL,
- `Battery` int(11) NOT NULL DEFAULT '-1',
- `Signal` int(11) NOT NULL DEFAULT '-1',
- `Sent` int(11) NOT NULL DEFAULT '0',
- `Received` int(11) NOT NULL DEFAULT '0'
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- --
- -- Дамп данных таблицы `phones`
- --
- --
- -- Триггеры `phones`
- --
- DELIMITER $$
- CREATE TRIGGER `phones_timestamp` BEFORE INSERT ON `phones` FOR EACH ROW BEGIN
- IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
- SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
- END IF;
- IF NEW.TimeOut = '0000-00-00 00:00:00' THEN
- SET NEW.TimeOut = CURRENT_TIMESTAMP();
- END IF;
- END
- $$
- DELIMITER ;
- -- --------------------------------------------------------
- --
- -- Структура таблицы `sentitems`
- --
- CREATE TABLE `sentitems` (
- `UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `SendingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `DeliveryDateTime` timestamp NULL DEFAULT NULL,
- `Text` text NOT NULL,
- `DestinationNumber` varchar(20) NOT NULL DEFAULT '',
- `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression',
- `UDH` text NOT NULL,
- `SMSCNumber` varchar(20) NOT NULL DEFAULT '',
- `Class` int(11) NOT NULL DEFAULT '-1',
- `TextDecoded` text NOT NULL,
- `ID` int(10) UNSIGNED NOT NULL DEFAULT '0',
- `SenderID` varchar(255) NOT NULL,
- `SequencePosition` int(11) NOT NULL DEFAULT '1',
- `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error') NOT NULL DEFAULT 'SendingOK',
- `StatusError` int(11) NOT NULL DEFAULT '-1',
- `TPMR` int(11) NOT NULL DEFAULT '-1',
- `RelativeValidity` int(11) NOT NULL DEFAULT '-1',
- `CreatorID` text NOT NULL
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
- --
- -- Триггеры `sentitems`
- --
- DELIMITER $$
- CREATE TRIGGER `sentitems_timestamp` BEFORE INSERT ON `sentitems` FOR EACH ROW BEGIN
- IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
- SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
- END IF;
- IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
- SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
- END IF;
- END
- $$
- DELIMITER ;
- --
- -- Индексы сохранённых таблиц
- --
- --
- -- Индексы таблицы `gammu`
- --
- ALTER TABLE `gammu`
- ADD PRIMARY KEY (`Version`);
- --
- -- Индексы таблицы `inbox`
- --
- ALTER TABLE `inbox`
- ADD PRIMARY KEY (`ID`);
- --
- -- Индексы таблицы `outbox`
- --
- ALTER TABLE `outbox`
- ADD PRIMARY KEY (`ID`),
- ADD KEY `outbox_date` (`SendingDateTime`,`SendingTimeOut`),
- ADD KEY `outbox_sender` (`SenderID`(250));
- --
- -- Индексы таблицы `outbox_multipart`
- --
- ALTER TABLE `outbox_multipart`
- ADD PRIMARY KEY (`ID`,`SequencePosition`);
- --
- -- Индексы таблицы `phones`
- --
- ALTER TABLE `phones`
- ADD PRIMARY KEY (`IMEI`);
- --
- -- Индексы таблицы `sentitems`
- --
- ALTER TABLE `sentitems`
- ADD PRIMARY KEY (`ID`,`SequencePosition`),
- ADD KEY `sentitems_date` (`DeliveryDateTime`),
- ADD KEY `sentitems_tpmr` (`TPMR`),
- ADD KEY `sentitems_dest` (`DestinationNumber`),
- ADD KEY `sentitems_sender` (`SenderID`(250));
- --
- -- AUTO_INCREMENT для сохранённых таблиц
- --
- --
- -- AUTO_INCREMENT для таблицы `inbox`
- --
- ALTER TABLE `inbox`
- MODIFY `ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
- --
- -- AUTO_INCREMENT для таблицы `outbox`
- --
- ALTER TABLE `outbox`
- MODIFY `ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement