123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- -- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for debian-linux-gnu (x86_64)
-
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
- /*!40101 SET NAMES utf8mb4 */;
- /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
- /*!40103 SET TIME_ZONE='+00:00' */;
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
- --
- -- Table structure for table `balances`
- --
-
- DROP TABLE IF EXISTS `balances`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `balances` (
- `meter_id` int(11) NOT NULL,
- `prs` double DEFAULT NULL,
- `tft` double DEFAULT NULL,
- `timestamp` datetime NOT NULL,
- KEY `meter_id` (`meter_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Table structure for table `blocks`
- --
-
- CREATE TABLE `blocks` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `blocknumber` int(11) DEFAULT NULL,
- `wallet_type` varchar(50) DEFAULT NULL,
- `wallet_from` varchar(50) DEFAULT NULL,
- `wallet_to` varchar(50) DEFAULT NULL,
- `asset` varchar(50) DEFAULT NULL,
- `amount` decimal(15,8) DEFAULT NULL,
- `timestamp` datetime DEFAULT NULL,
- `memo_hash` char(32) DEFAULT NULL,
- `tx_id` char(32) DEFAULT NULL,
- `type` enum('measure','payment','transfer','update_price') DEFAULT NULL,
- `purchased_sold` double DEFAULT NULL,
- `buy_price` double DEFAULT NULL,
- `sell_price` double DEFAULT NULL,
- `day` date GENERATED ALWAYS AS (cast(`timestamp` as date)) STORED,
- `mon` tinyint(4) unsigned GENERATED ALWAYS AS (month(`timestamp`)) STORED,
- `yea` smallint(5) unsigned GENERATED ALWAYS AS (year(`timestamp`)) STORED,
- PRIMARY KEY (`id`),
- KEY `ts` (`timestamp`),
- KEY `txid` (`tx_id`),
- KEY `day` (`day`),
- KEY `idx1` (`day`,`wallet_from`,`wallet_to`,`asset`,`type`),
- KEY `mon` (`mon`),
- KEY `yea` (`yea`),
- KEY `idx2` (`yea`,`mon`,`wallet_from`,`wallet_to`,`asset`,`type`),
- KEY `idx3` (`type`),
- KEY `idx4` (`wallet_from`,`wallet_to`)
- ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
- --
- -- Table structure for table `conf`
- --
-
- DROP TABLE IF EXISTS `conf`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `conf` (
- `conf_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
- `conf_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- INSERT INTO `conf` VALUES
- ('utility_account','name_of_utility_account'),
- ('topup_prs_limit','100'),
- ('topup_tft_limit','100'),
- ('topup_prs_transfer','100'),
- ('topup_tft_transfer','100'),
- ('topup_prs_memo','Automatic PRS top up'),
- ('topup_tft_memo','Automatic TFT top up');
-
- --
- -- Table structure for table `meter`
- --
-
- DROP TABLE IF EXISTS `meter`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `meter` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
- `location` varchar(255) COLLATE utf8mb4_unicode_ci NULL,
- `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE' COMMENT 'Possible status are ACTIVE HIDDEN DELETED SUSPENDED',
- `subid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
- `buy` double DEFAULT 0.1,
- `sell` double DEFAULT 0.1,
- `prs` double DEFAULT NULL,
- `tft` double DEFAULT NULL,
- `timestamp` datetime DEFAULT current_timestamp(),
- PRIMARY KEY (`id`),
- UNIQUE KEY `name` (`name`)
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Table structure for table `memo`
- --
-
- DROP TABLE IF EXISTS `memo`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `memo` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `block_id` int(11) DEFAULT NULL,
- `memo_key` varchar(255) DEFAULT NULL,
- `memo_value` varchar(512) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `block_id` (`block_id`),
- KEY `memo_key` (`memo_key`),
- KEY `memo_value` (`memo_value`)
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Table structure for table `pending_payments`
- --
-
- DROP TABLE IF EXISTS `pending_payments`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `pending_payments` (
- `tx_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Table structure for table `users`
- --
-
- DROP TABLE IF EXISTS `users`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `users` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `username` varchar(255) NOT NULL,
- `password` varchar(255) NOT NULL,
- `emailaddress` varchar(255) DEFAULT NULL,
- `role` varchar(20) DEFAULT NULL,
- `created` datetime DEFAULT NULL,
- `modified` datetime DEFAULT NULL,
- `meter_id` int(11) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
- INSERT INTO `users` VALUES (1,'admin','$2y$10$012BWTuRtKQEwpM/lWA1FumB6rITsjgnOGWj1zveBZTEVseWWuQze','admin_email@example.com','admin', NOW(), NOW(), NULL);
-
- /*!40101 SET character_set_client = @saved_cs_client */;
- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
- -- Dump completed on 2020-02-07 16:57:30
|