diff options
| author | Adam Soltys <[email protected]> | 2022-10-17 12:03:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-18 21:58:51 -0700 |
| commit | 1f3fef8eac67a6f7a96b567c5e0edcd923866117 (patch) | |
| tree | a92d954003132a4c0022123181a9a6e727947517 /db | |
| parent | a4cccc51652405d6c3d2b6edd2dba5627c3535ba (diff) | |
| download | coinos-server-1f3fef8eac67a6f7a96b567c5e0edcd923866117.tar.gz coinos-server-1f3fef8eac67a6f7a96b567c5e0edcd923866117.zip | |
clear node options during build
Diffstat (limited to 'db')
| -rw-r--r-- | db/schema.sql | 171 |
1 files changed, 26 insertions, 145 deletions
diff --git a/db/schema.sql b/db/schema.sql index 4f7e9b7d..cb533e0a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.9.3-MariaDB, for debian-linux-gnu (x86_64) +-- MariaDB dump 10.19 Distrib 10.6.1-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: coinos -- ------------------------------------------------------ --- Server version 10.9.3-MariaDB-1:10.9.3+maria~ubu2204 +-- Server version 10.6.1-MariaDB-1:10.6.1+maria~focal /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -19,7 +19,7 @@ -- Current Database: `coinos` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `coinos` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `coinos` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `coinos`; @@ -70,7 +70,7 @@ CREATE TABLE `accounts` ( `lightning_credits` double NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `asset` (`asset`) -) ENGINE=InnoDB AUTO_INCREMENT=38966 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=21711 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -109,18 +109,6 @@ CREATE TABLE `deposits` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `dupes` --- - -DROP TABLE IF EXISTS `dupes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `dupes` ( - `id` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- -- Table structure for table `invoices` -- @@ -136,12 +124,12 @@ CREATE TABLE `invoices` ( `rate` double DEFAULT NULL, `currency` varchar(255) NOT NULL, `address` varchar(255) DEFAULT NULL, - `received` bigint(20) DEFAULT NULL, - `amount` double DEFAULT NULL, + `received` bigint(20) NOT NULL DEFAULT 0, + `amount` bigint(20) DEFAULT NULL, `tip` double DEFAULT NULL, `network` varchar(255) DEFAULT NULL, `unconfidential` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT uuid(), `memo` text DEFAULT NULL, `account_id` int(11) DEFAULT NULL, `path` varchar(255) DEFAULT NULL, @@ -155,9 +143,10 @@ CREATE TABLE `invoices` ( KEY `address_index` (`address`(100)), KEY `invoices_user_id_foreign` (`user_id`), KEY `invoices_account_id_foreign` (`account_id`), - KEY `invoices_time_index` (`createdAt`), - KEY `uuid` (`uuid`(10)) -) ENGINE=InnoDB AUTO_INCREMENT=372769 DEFAULT CHARSET=latin1; + KEY `uuid` (`uuid`(10)), + CONSTRAINT `invoices_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`), + CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=48861 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -174,7 +163,7 @@ CREATE TABLE `linkingkeys` ( `createdAt` datetime NOT NULL, `updatedAt` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=26721 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=12634 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -190,7 +179,7 @@ CREATE TABLE `lnurl_migrations` ( `batch` int(11) DEFAULT NULL, `migration_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -204,7 +193,7 @@ CREATE TABLE `lnurl_migrations_lock` ( `index` int(10) unsigned NOT NULL AUTO_INCREMENT, `is_locked` int(11) DEFAULT NULL, PRIMARY KEY (`index`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -220,7 +209,7 @@ CREATE TABLE `migrations` ( `batch` int(11) DEFAULT NULL, `migration_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -234,7 +223,7 @@ CREATE TABLE `migrations_lock` ( `index` int(10) unsigned NOT NULL AUTO_INCREMENT, `is_locked` int(11) DEFAULT NULL, PRIMARY KEY (`index`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -297,124 +286,16 @@ CREATE TABLE `payments` ( `invoice_id` int(11) DEFAULT NULL, `fee_payment_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `accounts_hash_amount` (`account_id`,`amount`,`hash`(50)), - KEY `idx_redeemcode` (`redeemcode`), - KEY `payments_invoice_id_foreign` (`invoice_id`), - KEY `payments_user_id_foreign` (`user_id`), - KEY `payments_account_id_foreign` (`account_id`), - KEY `payments_time_index` (`createdAt`), - KEY `hash` (`hash`(10)), - CONSTRAINT `fk_account_id` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=208429 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `paymentsb` --- - -DROP TABLE IF EXISTS `paymentsb`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `paymentsb` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) DEFAULT NULL, - `hash` text DEFAULT NULL, - `createdAt` datetime NOT NULL, - `updatedAt` datetime NOT NULL, - `rate` double DEFAULT NULL, - `currency` varchar(255) DEFAULT NULL, - `address` varchar(255) DEFAULT NULL, - `received` tinyint(1) DEFAULT NULL, - `amount` double DEFAULT NULL, - `tip` double NOT NULL DEFAULT 0, - `confirmed` tinyint(1) NOT NULL, - `fee` double NOT NULL DEFAULT 0, - `network` varchar(255) DEFAULT NULL, - `account_id` int(11) DEFAULT NULL, - `preimage` varchar(255) DEFAULT NULL, - `memo` text DEFAULT NULL, - `redeemed` tinyint(1) NOT NULL DEFAULT 0, - `redeemcode` varchar(255) DEFAULT NULL, - `path` varchar(255) DEFAULT NULL, - `invoice_id` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `hash_2` (`hash`,`user_id`) USING HASH, KEY `idx_redeemcode` (`redeemcode`), KEY `payments_invoice_id_foreign` (`invoice_id`), KEY `payments_user_id_foreign` (`user_id`), KEY `payments_account_id_foreign` (`account_id`), - KEY `payments_time_index` (`createdAt`), - KEY `hash` (`hash`(10)) -) ENGINE=InnoDB AUTO_INCREMENT=146324 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `paymentsc` --- - -DROP TABLE IF EXISTS `paymentsc`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `paymentsc` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) DEFAULT NULL, - `hash` text DEFAULT NULL, - `createdAt` datetime NOT NULL, - `updatedAt` datetime NOT NULL, - `rate` double DEFAULT NULL, - `currency` varchar(255) DEFAULT NULL, - `address` varchar(255) DEFAULT NULL, - `received` tinyint(1) DEFAULT NULL, - `amount` double DEFAULT NULL, - `tip` double NOT NULL DEFAULT 0, - `confirmed` tinyint(1) NOT NULL, - `fee` double NOT NULL DEFAULT 0, - `network` varchar(255) DEFAULT NULL, - `account_id` int(11) DEFAULT NULL, - `preimage` varchar(255) DEFAULT NULL, - `memo` text DEFAULT NULL, - `redeemed` tinyint(1) NOT NULL DEFAULT 0, - `redeemcode` varchar(255) DEFAULT NULL, - `path` varchar(255) DEFAULT NULL, - `invoice_id` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `idx_redeemcode` (`redeemcode`), - KEY `payments_invoice_id_foreign` (`invoice_id`), - KEY `payments_account_id_foreign` (`account_id`), - KEY `payments_time_index` (`createdAt`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `paymentsnew` --- - -DROP TABLE IF EXISTS `paymentsnew`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `paymentsnew` ( - `id` int(11) NOT NULL DEFAULT 0, - `user_id` int(11) DEFAULT NULL, - `hash` text DEFAULT NULL, - `createdAt` datetime NOT NULL, - `updatedAt` datetime NOT NULL, - `rate` double DEFAULT NULL, - `currency` varchar(255) DEFAULT NULL, - `address` varchar(255) DEFAULT NULL, - `received` tinyint(1) DEFAULT NULL, - `amount` double DEFAULT NULL, - `tip` double NOT NULL DEFAULT 0, - `confirmed` tinyint(1) NOT NULL, - `fee` double NOT NULL DEFAULT 0, - `network` varchar(255) DEFAULT NULL, - `account_id` int(11) DEFAULT NULL, - `preimage` varchar(255) DEFAULT NULL, - `memo` text DEFAULT NULL, - `redeemed` tinyint(1) NOT NULL DEFAULT 0, - `redeemcode` varchar(255) DEFAULT NULL, - `path` varchar(255) DEFAULT NULL, - `invoice_id` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + KEY `fk_payments` (`fee_payment_id`), + CONSTRAINT `fk_payments` FOREIGN KEY (`fee_payment_id`) REFERENCES `payments` (`id`), + CONSTRAINT `payments_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`), + CONSTRAINT `payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`), + CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=30044 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -451,7 +332,7 @@ CREATE TABLE `referrals` ( KEY `referrals_sponsor_id_foreign` (`sponsor_id`), CONSTRAINT `referrals_sponsor_id_foreign` FOREIGN KEY (`sponsor_id`) REFERENCES `users` (`id`), CONSTRAINT `referrals_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -471,7 +352,7 @@ CREATE TABLE `urls` ( `createdAt` timestamp NOT NULL DEFAULT current_timestamp(), `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(), UNIQUE KEY `urls_hash_unique` (`hash`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -513,7 +394,7 @@ CREATE TABLE `users` ( PRIMARY KEY (`id`), KEY `ip` (`ip`), KEY `username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=29850 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=15479 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -572,4 +453,4 @@ CREATE TABLE `withdrawals` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-10-08 6:29:13 +-- Dump completed on 2022-10-14 17:10:15 |
