-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCHEMA.sql
executable file
·123 lines (103 loc) · 3.41 KB
/
SCHEMA.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
-- phpMyAdmin SQL Dump
-- version 4.0.4.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 12, 2013 at 04:01 PM
-- Server version: 5.5.32-0ubuntu0.13.04.1
-- PHP Version: 5.4.9-4ubuntu2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `rpcharts`
--
CREATE DATABASE IF NOT EXISTS `rpcharts` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `rpcharts`;
-- --------------------------------------------------------
--
-- Table structure for table `articles`
--
CREATE TABLE IF NOT EXISTS `articles` (
`title` varchar(100) NOT NULL,
`category` varchar(10) NOT NULL,
`summary` text NOT NULL,
`url` tinytext NOT NULL,
`publish_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `caps`
--
CREATE TABLE IF NOT EXISTS `caps` (
`c` smallint(5) unsigned NOT NULL,
`i` smallint(5) unsigned NOT NULL,
`type` tinyint(1) unsigned NOT NULL COMMENT '0 = circulation, 1 = hot wallet',
`time` datetime NOT NULL,
`ledger` int(10) unsigned NOT NULL,
`amount` double NOT NULL,
UNIQUE KEY `c` (`c`,`i`,`type`,`time`),
KEY `ledger` (`ledger`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `config`
--
CREATE TABLE IF NOT EXISTS `config` (
`key` varchar(32) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `ledgers`
--
CREATE TABLE IF NOT EXISTS `ledgers` (
`id` int(10) unsigned NOT NULL,
`hash` char(64) NOT NULL,
`xrp` bigint(20) unsigned NOT NULL,
`accounts_delta` int(10) unsigned NOT NULL,
`txs` mediumint(8) unsigned NOT NULL,
`fees` int(10) unsigned NOT NULL,
`txs_xrp_total` bigint(8) unsigned NOT NULL,
`time` datetime NOT NULL,
`txs_cross` mediumint(8) unsigned NOT NULL,
`txs_trade` mediumint(8) unsigned NOT NULL,
`evt_trade` mediumint(8) unsigned NOT NULL,
`txs_paytrade` mediumint(8) unsigned NOT NULL,
`entries_delta` mediumint(8) NOT NULL,
`offers_placed` mediumint(8) unsigned NOT NULL,
`offers_taken` mediumint(8) unsigned NOT NULL,
`offers_canceled` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `ledgers_aggregate`
--
CREATE TABLE IF NOT EXISTS `ledgers_aggregate` (
`time` datetime NOT NULL,
`ledger_first` int(10) unsigned NOT NULL,
`ledger_last` int(10) unsigned NOT NULL,
`txs` int(10) unsigned NOT NULL,
`accounts_delta` int(10) unsigned NOT NULL,
UNIQUE KEY `time` (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `trades`
--
CREATE TABLE IF NOT EXISTS `trades` (
`c1` smallint(5) unsigned NOT NULL,
`i1` smallint(5) unsigned NOT NULL,
`c2` smallint(5) unsigned NOT NULL,
`i2` smallint(5) unsigned NOT NULL,
`book` smallint(5) unsigned NOT NULL,
`time` datetime NOT NULL,
`ledger` int(10) unsigned NOT NULL,
`tx` smallint(5) unsigned NOT NULL,
`order` smallint(5) unsigned NOT NULL,
`price` double NOT NULL,
`amount` double NOT NULL,
KEY `ledger` (`ledger`),
KEY `book` (`c1`,`i1`,`c2`,`i2`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;