1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
2 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
3 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
4 /*!40101 SET NAMES utf8 */;
5 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
6 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
7 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
9 CREATE SCHEMA IF NOT EXISTS `precog`;
10 DROP DATABASE `precog`;
11 CREATE SCHEMA `precog`;
15 # Dump of table chains
16 # ------------------------------------------------------------
18 CREATE TABLE `chains` (
19 `id` tinyint(1) NOT NULL AUTO_INCREMENT,
20 `best_height` int(11) DEFAULT '0',
21 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
22 `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
24 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
26 LOCK TABLES `chains` WRITE;
31 # ------------------------------------------------------------
33 CREATE TABLE `nodes` (
34 `id` int(11) NOT NULL AUTO_INCREMENT,
35 `alias` varchar(128) NOT NULL DEFAULT '',
36 `pub_key` char(128) NOT NULL DEFAULT '',
37 `host` varchar(128) NOT NULL DEFAULT '',
38 `port` smallint unsigned NOT NULL DEFAULT '0',
39 `best_height` int(11) DEFAULT '0',
40 `lantency_ms` int(11) DEFAULT NULL,
41 `status` tinyint(1) NOT NULL DEFAULT '0',
42 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
43 `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
45 UNIQUE KEY `pub_key` (`pub_key`),
46 UNIQUE KEY `host_port` (`host`,`port`)
47 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
49 LOCK TABLES `nodes` WRITE;