Web Interfaces of PROSUME

prosume.sql 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. -- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for debian-linux-gnu (x86_64)
  2. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  3. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  4. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  5. /*!40101 SET NAMES utf8mb4 */;
  6. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  7. /*!40103 SET TIME_ZONE='+00:00' */;
  8. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  9. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  10. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  11. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  12. --
  13. -- Table structure for table `balances`
  14. --
  15. DROP TABLE IF EXISTS `balances`;
  16. /*!40101 SET @saved_cs_client = @@character_set_client */;
  17. /*!40101 SET character_set_client = utf8 */;
  18. CREATE TABLE `balances` (
  19. `hgm_id` int(11) NOT NULL,
  20. `prs` double DEFAULT NULL,
  21. `tft` double DEFAULT NULL,
  22. `timestamp` datetime NOT NULL DEFAULT current_timestamp(),
  23. KEY `hgm_id` (`hgm_id`),
  24. CONSTRAINT `balances_ibfk_1` FOREIGN KEY (`hgm_id`) REFERENCES `hgm` (`id`)
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  26. /*!40101 SET character_set_client = @saved_cs_client */;
  27. --
  28. -- Table structure for table `blocks`
  29. --
  30. DROP TABLE IF EXISTS `blocks`;
  31. /*!40101 SET @saved_cs_client = @@character_set_client */;
  32. /*!40101 SET character_set_client = utf8 */;
  33. CREATE TABLE `blocks` (
  34. `id` int(11) NOT NULL AUTO_INCREMENT,
  35. `blocknumber` int(11) DEFAULT NULL,
  36. `wallet_type` varchar(50) DEFAULT NULL,
  37. `wallet_from` varchar(50) DEFAULT NULL,
  38. `wallet_to` varchar(50) DEFAULT NULL,
  39. `asset` varchar(50) DEFAULT NULL,
  40. `amount` decimal(15,8) DEFAULT NULL,
  41. `timestamp` datetime DEFAULT NULL,
  42. `memo_hash` char(32) DEFAULT NULL,
  43. `tx_id` char(32) DEFAULT NULL,
  44. `type` enum('measure','payment','transfer') DEFAULT NULL,
  45. `purchased_sold` double DEFAULT NULL,
  46. `buy_price` double DEFAULT NULL,
  47. `sell_price` double DEFAULT NULL,
  48. PRIMARY KEY (`id`),
  49. KEY `blocknumber_timestamp_asset_wallet_from_wallet_to` (`blocknumber`,`timestamp`,`asset`,`wallet_from`,`wallet_to`,`memo_hash`)
  50. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  51. /*!40101 SET character_set_client = @saved_cs_client */;
  52. --
  53. -- Table structure for table `conf`
  54. --
  55. DROP TABLE IF EXISTS `conf`;
  56. /*!40101 SET @saved_cs_client = @@character_set_client */;
  57. /*!40101 SET character_set_client = utf8 */;
  58. CREATE TABLE `conf` (
  59. `conf_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  60. `conf_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  61. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  62. /*!40101 SET character_set_client = @saved_cs_client */;
  63. INSERT INTO `conf` VALUES
  64. ('utility_account','name_of_utility_account'),
  65. ('topup_prs_limit','100'),
  66. ('topup_tft_limit','100'),
  67. ('topup_prs_transfer','100'),
  68. ('topup_tft_transfer','100'),
  69. ('topup_prs_memo','Automatic PRS top up'),
  70. ('topup_tft_memo','Automatic TFT top up');
  71. --
  72. -- Table structure for table `hgm`
  73. --
  74. DROP TABLE IF EXISTS `hgm`;
  75. /*!40101 SET @saved_cs_client = @@character_set_client */;
  76. /*!40101 SET character_set_client = utf8 */;
  77. CREATE TABLE `hgm` (
  78. `id` int(11) NOT NULL AUTO_INCREMENT,
  79. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  80. `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE' COMMENT 'Possible status are ACTIVE HIDDEN DELETED SUSPENDED',
  81. `subid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  82. `buy` double DEFAULT 0.1,
  83. `sell` double DEFAULT 0.1,
  84. `prs` double DEFAULT NULL,
  85. `tft` double DEFAULT NULL,
  86. `timestamp` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  87. PRIMARY KEY (`id`),
  88. UNIQUE KEY `name` (`name`)
  89. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  90. /*!40101 SET character_set_client = @saved_cs_client */;
  91. --
  92. -- Table structure for table `memo`
  93. --
  94. DROP TABLE IF EXISTS `memo`;
  95. /*!40101 SET @saved_cs_client = @@character_set_client */;
  96. /*!40101 SET character_set_client = utf8 */;
  97. CREATE TABLE `memo` (
  98. `id` int(11) NOT NULL AUTO_INCREMENT,
  99. `block_id` int(11) DEFAULT NULL,
  100. `memo_key` varchar(255) DEFAULT NULL,
  101. `memo_value` varchar(512) DEFAULT NULL,
  102. PRIMARY KEY (`id`),
  103. KEY `block_id` (`block_id`),
  104. KEY `memo_key` (`memo_key`),
  105. KEY `memo_value` (`memo_value`)
  106. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  107. /*!40101 SET character_set_client = @saved_cs_client */;
  108. --
  109. -- Table structure for table `pending_payments`
  110. --
  111. DROP TABLE IF EXISTS `pending_payments`;
  112. /*!40101 SET @saved_cs_client = @@character_set_client */;
  113. /*!40101 SET character_set_client = utf8 */;
  114. CREATE TABLE `pending_payments` (
  115. `tx_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  116. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  117. /*!40101 SET character_set_client = @saved_cs_client */;
  118. --
  119. -- Table structure for table `users`
  120. --
  121. DROP TABLE IF EXISTS `users`;
  122. /*!40101 SET @saved_cs_client = @@character_set_client */;
  123. /*!40101 SET character_set_client = utf8 */;
  124. CREATE TABLE `users` (
  125. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  126. `username` varchar(255) NOT NULL,
  127. `password` varchar(255) NOT NULL,
  128. `emailaddress` varchar(255) DEFAULT NULL,
  129. `role` varchar(20) DEFAULT NULL,
  130. `created` datetime DEFAULT NULL,
  131. `modified` datetime DEFAULT NULL,
  132. `hgm_id` int(11) DEFAULT NULL,
  133. PRIMARY KEY (`id`)
  134. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  135. INSERT INTO `users` VALUES (1,'admin','$2y$10$012BWTuRtKQEwpM/lWA1FumB6rITsjgnOGWj1zveBZTEVseWWuQze','admin_email@example.com','admin', NOW(), NOW(), NULL);
  136. /*!40101 SET character_set_client = @saved_cs_client */;
  137. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  138. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  139. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  140. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  141. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  142. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  143. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  144. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  145. -- Dump completed on 2020-02-07 16:57:30