-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.8.0.6908
-- --------------------------------------------------------



-- Dumping database structure for kval_darbs_riters
CREATE DATABASE IF NOT EXISTS `kval_darbs_riters` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `kval_darbs_riters`;

-- Dumping structure for table kval_darbs_riters.rr_410_accounts
CREATE TABLE IF NOT EXISTS `rr_410_accounts` (
  `account_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'konkreta konta id',
  `profile_id` int(11) unsigned NOT NULL COMMENT 'profila kas atbilst kontam id',
  `account_name` varchar(50) NOT NULL COMMENT 'konta nosaukums',
  PRIMARY KEY (`account_id`) USING BTREE,
  KEY `FK__profile` (`profile_id`),
  CONSTRAINT `FK__profile` FOREIGN KEY (`profile_id`) REFERENCES `rr_410_profile` (`profile_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table kval_darbs_riters.rr_410_accounts: ~7 rows (approximately)
INSERT INTO `rr_410_accounts` (`account_id`, `profile_id`, `account_name`) VALUES
	(1, 1, 'subacc1'),
	(8, 1, 'hhello'),
	(10, 3, 'profils1'),
	(11, 4, 'hakers'),
	(14, 7, 'testins1subbaccount'),
	(16, 8, 'hellosub h23'),
	(28, 9, 'subacc1');

-- Dumping structure for table kval_darbs_riters.rr_410_coin
CREATE TABLE IF NOT EXISTS `rr_410_coin` (
  `coin_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `coin_name` varchar(50) NOT NULL,
  PRIMARY KEY (`coin_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table kval_darbs_riters.rr_410_coin: ~47 rows (approximately)
INSERT INTO `rr_410_coin` (`coin_id`, `coin_name`) VALUES
	(1, 'fee'),
	(2, 'grunde'),
	(3, 'sfe'),
	(4, 'qr'),
	(5, 'wf'),
	(6, 'dwqw'),
	(7, 'btcb'),
	(8, 'btcbg1234'),
	(9, 'rt'),
	(10, 'pepe'),
	(11, 'karlis'),
	(12, 'lima'),
	(13, 'reinis'),
	(14, 'ge'),
	(16, 'jeee'),
	(17, 'lockharts21'),
	(19, 'karlisss'),
	(20, '1000beta'),
	(23, 'hermiones'),
	(24, 'albus'),
	(25, 'btc'),
	(26, 'Hello3'),
	(32, 'new1'),
	(33, 'ETH'),
	(34, 'popcat'),
	(35, 'return'),
	(36, 'bitcoin'),
	(37, 'grunde5'),
	(38, 'ruffus'),
	(39, 'gr'),
	(40, 'gr1'),
	(41, 'gr12'),
	(44, 'gr123'),
	(45, 'rs'),
	(46, 'rrr'),
	(47, 'hellokitija'),
	(48, 'hellokitija12'),
	(49, 'tests'),
	(50, 'popcats'),
	(51, ''),
	(52, 'rihards'),
	(53, 'popcats21'),
	(54, 'popcats32'),
	(55, '3'),
	(56, 'grunde1'),
	(57, 'grunde12'),
	(58, 'testins');

-- Dumping structure for table kval_darbs_riters.rr_410_coinpair
CREATE TABLE IF NOT EXISTS `rr_410_coinpair` (
  `coinpair_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `coinpair_name` varchar(50) NOT NULL,
  PRIMARY KEY (`coinpair_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table kval_darbs_riters.rr_410_coinpair: ~29 rows (approximately)
INSERT INTO `rr_410_coinpair` (`coinpair_id`, `coinpair_name`) VALUES
	(1, 'edd'),
	(2, 'fwef'),
	(3, 'wef'),
	(4, 'qwd'),
	(5, 'rt56'),
	(6, 'usdttg'),
	(7, 'usdttg3'),
	(8, 'rt'),
	(9, 'usdt14'),
	(10, 'usdt13'),
	(11, 'rihardu'),
	(12, 'eursd34'),
	(13, 'ee'),
	(14, 'eg'),
	(15, 'ralfs'),
	(16, 'juuu'),
	(18, 'rihardus'),
	(21, 'granger12'),
	(23, 'USDT'),
	(24, 'Hello123'),
	(26, 'eur'),
	(27, 'solana'),
	(28, 'fw'),
	(29, 'hw'),
	(30, 'grr'),
	(31, 'usd'),
	(32, 'ef'),
	(33, ''),
	(34, '2');

-- Dumping structure for table kval_darbs_riters.rr_410_direction
CREATE TABLE IF NOT EXISTS `rr_410_direction` (
  `direction_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `direction` varchar(5) NOT NULL,
  PRIMARY KEY (`direction_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table kval_darbs_riters.rr_410_direction: ~2 rows (approximately)
INSERT INTO `rr_410_direction` (`direction_id`, `direction`) VALUES
	(1, 'Long'),
	(2, 'Short');

-- Dumping structure for table kval_darbs_riters.rr_410_history_input
CREATE TABLE IF NOT EXISTS `rr_410_history_input` (
  `trade_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `account_id` int(11) unsigned NOT NULL,
  `coin_id` int(11) unsigned NOT NULL,
  `coinpair_id` int(11) unsigned NOT NULL,
  `direction_id` int(11) unsigned NOT NULL,
  `open_price` decimal(23,15) unsigned NOT NULL,
  `close_price` decimal(23,15) unsigned NOT NULL,
  `leverage` int(5) unsigned NOT NULL DEFAULT 1,
  `close_date` date DEFAULT NULL,
  `photo` blob DEFAULT NULL,
  `percents` decimal(7,2) DEFAULT NULL,
  PRIMARY KEY (`trade_id`) USING BTREE,
  KEY `FK_rr_410_history_input_rr_410_accounts` (`account_id`),
  KEY `FK_rr_410_history_input_rr_410_coin` (`coin_id`),
  KEY `FK_rr_410_history_input_rr_410_coinpair` (`coinpair_id`),
  KEY `FK_rr_410_history_input_rr_410_direction` (`direction_id`),
  CONSTRAINT `FK_rr_410_history_input_rr_410_accounts` FOREIGN KEY (`account_id`) REFERENCES `rr_410_accounts` (`account_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_rr_410_history_input_rr_410_coin` FOREIGN KEY (`coin_id`) REFERENCES `rr_410_coin` (`coin_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_rr_410_history_input_rr_410_coinpair` FOREIGN KEY (`coinpair_id`) REFERENCES `rr_410_coinpair` (`coinpair_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_rr_410_history_input_rr_410_direction` FOREIGN KEY (`direction_id`) REFERENCES `rr_410_direction` (`direction_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table kval_darbs_riters.rr_410_history_input: ~70 rows (approximately)
INSERT INTO `rr_410_history_input` (`trade_id`, `account_id`, `coin_id`, `coinpair_id`, `direction_id`, `open_price`, `close_price`, `leverage`, `close_date`, `photo`, `percents`) VALUES
	(5, 1, 11, 11, 1, 31.500000000000000, 32.000000000000000, 100, '2024-10-02', NULL, NULL),
	(11, 1, 8, 10, 2, 34.000000000000000, 35.000000000000000, 3, '2024-10-12', NULL, -8.82),
	(19, 1, 10, 10, 1, 123.000000000000000, 12.000000000000000, 1, '2024-10-10', NULL, -90.24),
	(21, 1, 11, 10, 1, 12.000000000000000, 1.000000000000000, 4, '2024-10-01', NULL, -366.67),
	(22, 1, 16, 16, 1, 12.000000000000000, 22.000000000000000, 3, '2024-10-17', NULL, 250.00),
	(23, 1, 10, 6, 1, 5.560000000000000, 5.000000000000000, 10, '2024-10-15', _binary 0x6261636b6965652d3238363734352d6c616e6473636170652e6a7067, -100.72),
	(24, 1, 8, 12, 1, 0.045000000000000, 0.100000000000000, 3, '2024-10-15', _binary 0x6261636b6965652d3236353636312d6c616e647363617065202831292e6a7067, 366.00),
	(27, 8, 10, 11, 1, 0.030000000000000, 0.090000000000000, 7, '2024-10-10', _binary 0x4469676573745f617574682e706e67, 1400.00),
	(33, 1, 2, 21, 1, 10.000007476000000, 100.576575676576580, 1, '2024-10-10', _binary 0x41544339302e6a7067, 905.00),
	(37, 14, 25, 23, 2, 654503.000000000000000, 636700.000000000000000, 10, '2024-10-25', _binary 0x30355f4965647665736d612e706e67, 27.20),
	(38, 16, 26, 24, 1, 12.356475000000000, 13.453552344420000, 15, '2024-10-11', _binary 0x30325f4965647665736d612e706e67, 133.18),
	(43, 1, 2, 5, 1, 1.000000000000000, 2.000000000000000, 18, '2024-11-04', _binary 0x35537465707344446f532d393630783634302e6a7067, 1800.00),
	(45, 1, 34, 23, 2, 6100.000000000000000, 5867.000000000000000, 10, '2024-11-02', _binary 0x5368617265202834292e706e67, 38.00),
	(50, 1, 2, 10, 1, 3.000000000000000, 4.000000000000000, 13, '2024-11-12', _binary 0x556e7469746c656420576f726b73706163652e706e67, 433.33),
	(51, 1, 50, 23, 2, 4.000000000000000, 1.000000000000000, 1, '2024-11-12', _binary 0x6672656570696b5f5f63616e6469642d696d6167652d70686f746f6772617068792d6e61747572616c2d74657874757265732d686967686c792d725f5f31323335332e6a706567, 75.00),
	(52, 1, 37, 5, 1, 6.000000000000000, 5.450000000000000, 10, '2024-11-12', NULL, -91.00),
	(55, 1, 36, 28, 1, 3.000000000000000, 2.000000000000000, 12, '2024-11-13', NULL, -400.00),
	(56, 1, 2, 6, 1, 1.000000000000000, 2.000000000000000, 12, '2024-11-13', NULL, 1200.00),
	(57, 1, 38, 29, 1, 45.000000000000000, 45.000000000000000, 1, '2024-11-12', NULL, 0.00),
	(58, 28, 39, 30, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-13', NULL, 100.00),
	(59, 28, 39, 23, 1, 13.000000000000000, 12.000000000000000, 10, '2024-11-12', _binary 0x5368617265202834292e706e67, -76.00),
	(60, 28, 44, 23, 2, 3.000000000000000, 4.000000000000000, 10, '2024-11-13', NULL, -333.00),
	(61, 28, 39, 23, 1, 34.000000000000000, 43.000000000000000, 1, '2024-11-13', NULL, 26.47),
	(62, 28, 25, 31, 2, 2221.000000000000000, 1922.245430000000000, 1, '2024-11-13', NULL, 13.45),
	(63, 28, 25, 30, 1, 2.000000000000000, 3.000000000000000, 1, '2024-11-13', NULL, 50.00),
	(64, 28, 25, 23, 2, 3.000000000000000, 1.000000000000000, 1, '2024-11-13', NULL, 66.67),
	(65, 1, 45, 32, 1, 1.000000000000000, 13.000000000000000, 1, '2024-11-14', NULL, 1200.00),
	(66, 1, 2, 5, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-14', NULL, 100.00),
	(67, 1, 8, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-14', NULL, 100.00),
	(68, 1, 8, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-14', NULL, 100.00),
	(70, 1, 8, 6, 1, 44.000000000000000, 4.000000000000000, 1, '2024-11-14', NULL, -90.91),
	(72, 1, 2, 6, 1, 2.000000000000000, 2.000000000000000, 1, '2024-11-14', NULL, 0.00),
	(73, 1, 2, 5, 1, 2.000000000000000, 2.000000000000000, 1, '2024-11-14', NULL, 0.00),
	(79, 1, 2, 5, 1, 0.000000000000000, 6.000000000000000, 1, '2024-11-17', NULL, -300.00),
	(80, 1, 49, 6, 1, 2.000000000000000, 3.000000000000000, 0, '2024-11-17', NULL, -150.00),
	(81, 1, 45, 6, 1, 2.000000000000000, 3.000000000000000, 1, '2024-11-17', NULL, 50.00),
	(82, 1, 51, 6, 2, 12.000000000000000, 2.000000000000000, 1, '2024-11-19', NULL, 83.33),
	(83, 1, 2, 33, 1, 4.000000000000000, 5.000000000000000, 1, '2024-11-19', NULL, 25.00),
	(84, 1, 8, 5, 1, 14.000000000000000, 15.000000000000000, 1, '2024-11-19', NULL, 7.14),
	(85, 1, 8, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, 100.00),
	(86, 1, 2, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, 100.00),
	(87, 1, 10, 5, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, 100.00),
	(88, 1, 38, 6, 2, 2.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, 50.00),
	(89, 1, 11, 29, 2, 21.000000000000000, 12.000000000000000, 1, '2024-11-20', NULL, 42.00),
	(90, 1, 2, 5, 1, 2.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, -50.00),
	(91, 1, 52, 6, 2, 3.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, 66.00),
	(92, 1, 8, 6, 2, 3.000000000000000, 4.000000000000000, 1, '2024-11-20', NULL, -33.00),
	(93, 1, 8, 6, 1, 3.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, -66.67),
	(94, 1, 52, 6, 1, 3.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, -33.00),
	(95, 1, 8, 10, 1, 2.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, -50.00),
	(98, 1, 54, 6, 1, 1.000000000000000, 2.000000000000000, 12, '2024-11-20', NULL, 1200.00),
	(101, 1, 2, 6, 1, 24.000000000000000, 34.000000000000000, 1, '2024-11-20', NULL, 41.67),
	(102, 1, 8, 6, 1, 2.000000000000000, 3.000000000000000, 1, '2024-11-20', NULL, 50.00),
	(103, 1, 2, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, 100.00),
	(104, 1, 55, 34, 1, 3.000000000000000, 3.000000000000000, 1, '2024-11-20', NULL, 0.00),
	(105, 1, 57, 6, 1, 2.000000000000000, 3.000000000000000, 1, '2024-11-20', NULL, 50.00),
	(106, 1, 8, 6, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-20', NULL, 100.00),
	(107, 1, 10, 6, 1, 2.000000000000000, 1.000000000000000, 1, '2024-11-20', NULL, -50.00),
	(108, 1, 8, 5, 1, 12.000000000000000, 224.000000000000000, 1, '2024-11-20', NULL, 1766.67),
	(109, 1, 2, 6, 1, 2.000000000000000, 2.000000000000000, 1, '2024-11-21', NULL, 0.00),
	(110, 1, 10, 10, 1, 3.000000000000000, 3.000000000000000, 1, '2024-11-21', NULL, 0.00),
	(111, 1, 8, 10, 1, 1.000000000000000, 2.000000000000000, 1, '2024-11-21', NULL, 100.00),
	(112, 1, 8, 6, 1, 1.000000000000000, 1.000000000000000, 1, '2024-11-21', NULL, 0.00),
	(113, 1, 8, 6, 1, 111.000000000000000, 1.000000000000000, 1, '2024-11-21', NULL, -99.10),
	(114, 1, 10, 10, 1, 2.000000000000000, 2.000000000000000, 1, '2024-11-21', NULL, 0.00),
	(115, 1, 8, 6, 1, 22.000000000000000, 2.000000000000000, 1, '2024-11-21', NULL, -90.91),
	(116, 1, 8, 6, 1, 2.000000000000000, 4.000000000000000, 1, '2024-11-21', NULL, 100.00),
	(117, 1, 2, 6, 2, 2.000000000000000, 23.000000000000000, 1, '2024-11-21', NULL, -1050.00),
	(118, 1, 58, 21, 1, 3.000000000000000, 4.000000000000000, 1, '2024-11-21', NULL, 33.33),
	(119, 1, 25, 26, 1, 21.000000000000000, 22.000000000000000, 15, '2024-11-21', _binary 0x564941415f4a656c676176615f323131312d372e6a7067, 71.00);

