Bitcoin Forum
November 09, 2024, 12:39:59 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Pushpoold MySQL Tables & Columns Query! SQL Template  (Read 2042 times)
Flowz (OP)
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
July 23, 2011, 10:31:39 AM
Last edit: July 24, 2011, 07:37:53 PM by Flowz
 #1

This is the sql file if you're only going to run the BACK-END (pushpool) of a pool, you don't need this one i you're going to install a front-end like MiningFarm.

I haven't found ANY 'sql' template for it so here are the queries to get the database working:
I already added one worker: with the username 'test and password 'test'.
Save it as: 'somethingyouwant.sql' and then import it in your database!
Make sure to start with a clean/empty database!
Code:
-- phpMyAdmin SQL Dump
-- version 3.3.10.2
-- http://www.phpmyadmin.net
--
-- Machine: localhost
-- Genereertijd: 23 Jul 2011 om 06:28
-- Serverversie: 5.0.92
-- PHP-Versie: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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 utf8 */;


CREATE TABLE IF NOT EXISTS `pool_worker` (
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



INSERT INTO `pool_worker` (`username`, `password`) VALUES
('test', 'test');



CREATE TABLE IF NOT EXISTS `shares` (
  `id` bigint(30) NOT NULL auto_increment,
  `time` int(4) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') default NULL,
  `reason` varchar(50) default NULL,
  `solution` varchar(257) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=344576 ;
Corrections by: dikidera & Viceroy.


This SQL dump is also a fix to the following error:
Code:
Listening on host :: port 8342
Listening on host :: port 8347
Listening on host :: port 8344
Listening on host 127.0.0.1 port 8338
initialized
mysql sharelog failed at execute
shutting down
Use the above SQL template to fix the above error!

Donations are welcome!
115eiD1Hcpw84NHJrpruAWetpziMDaFF2t
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 23, 2011, 10:38:48 PM
 #2

You forgot some stuff Smiley

Code:
delimiter $$

CREATE TABLE `pool_worker` (
  `ID` int(8) NOT NULL default '100000',
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `ID_UNIQUE` (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1$$

CREATE TABLE `shares` (
  `id` bigint(30) NOT NULL auto_increment,
  `time` int(4) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') default NULL,
  `reason` varchar(50) default NULL,
  `solution` varchar(255) NOT NULL,
  `timestamp` timestamp NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1$$
Flowz (OP)
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
July 23, 2011, 10:54:46 PM
 #3

You forgot some stuff Smiley

Code:
delimiter $$

CREATE TABLE `pool_worker` (
  `ID` int(8) NOT NULL default '100000',
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `ID_UNIQUE` (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1$$

CREATE TABLE `shares` (
  `id` bigint(30) NOT NULL auto_increment,
  `time` int(4) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') default NULL,
  `reason` varchar(50) default NULL,
  `solution` varchar(255) NOT NULL,
  `timestamp` timestamp NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1$$

I forgot nothing, this is just to support the back-end of a pool! You posted columns that are needed by the front-end!
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 23, 2011, 11:17:20 PM
 #4

Calm down, world leader,    Roll Eyes



I Modified your create statement to include an ID and a timestamp. 
I thought those might be helpful.


Flowz (OP)
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
July 23, 2011, 11:25:42 PM
 #5

Calm down, world leader,    Roll Eyes



I Modified your create statement to include an ID and a timestamp. 
I thought those might be helpful.



Oh, you mis-understood the feeling I was trying to express with that post.
I was trying to say: 'thanks for pointing that out! But it's not needed for the back-end to work properly.' but I used different words wich might come over more aggresivly and ignorantly!
I apoligize for that.
Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
July 24, 2011, 06:10:39 AM
 #6

As developer of MiningFarm I approve this message, should work for anybody wanting to do some quick and easy startup of their own pool. Smiley
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
July 24, 2011, 08:26:39 AM
 #7

hmm, isnt it better to stick on one db engine? Stick to InnoDB

Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 24, 2011, 01:28:13 PM
 #8

yes,


I do apologize for that you are correct.  There is a complete sql create statement in the front end of "miningFarm".
dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
July 24, 2011, 04:11:28 PM
 #9

Yeah, sorry, but them fields are a tad bit incorrect. Flowz, before you start handing out 'templates' at least learn how the sizes work.
Flowz (OP)
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
July 24, 2011, 04:22:51 PM
 #10

Yeah, sorry, but them fields are a tad bit incorrect. Flowz, before you start handing out 'templates' at least learn how the sizes work.
Mind providing a correcter version of it then?
dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
July 24, 2011, 04:31:30 PM
 #11

Yeah, sorry, but them fields are a tad bit incorrect. Flowz, before you start handing out 'templates' at least learn how the sizes work.
Mind providing a correcter version of it then?

For starters, let's look at the pool_worker table. We see that the username has a max length of 255 characters. All good and everything...but

The shares table's username field is capped at 120, meaning if i were to register with

Quote
tgregereryt3483734u9euffjifuweu90ewur903u94u390udepojfsdifh098ur590u3ueojfpoidi ojr093ur903ejfiopjf09ur903ru03riewjijc90ru93309u3r
It will get truncated to 120 characters when inserting shares in the DB.
And if you decide to pull my stats from the shares table, you won't be able to, cause there is no such user that matches that username.

If we look at the solution field, it's length is only 255 characters, while in truth it's 256 if i remember correctly. It's not very important, since phoenix itself ignores the last few bytes/characters of the solution so it doesnt send them, but for good practice, better set it to that amount.

Also, are you seriously thinking someone is going to register with a password that is 255 characters long? Lol no, moreover it will be hashed. 64 characters for a password(max bytes for a sha256 hash), and from 60 to 80 for username is plenty.

Also, not to brag, but i was the one who gave the table structure to xenland when he first started developing "miningFarm". Altho, this one, you posted differs.
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 24, 2011, 05:35:21 PM
 #12

I take no credit for any of the above.  I just added an ID column to the miner table and a timestamp in the shares in the above post.  

Here is the complete sql creation file from miningfarm:
(Only shares and pool_worker are needed to make pushpool run.)


Code:
-- phpMyAdmin SQL Dump
-- version 3.3.2deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 21, 2011 at 03:34 PM
-- Server version: 5.1.41
-- PHP Version: 5.3.2-1ubuntu4.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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 utf8 */;

--
-- Database: `miningfarm`
--

-- --------------------------------------------------------

--
-- Table structure for table `accountBalance`
--

CREATE TABLE IF NOT EXISTS `accountBalance` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `userId` int(255) NOT NULL,
  `balance` varchar(10) NOT NULL,
  `payoutAddress` varchar(255) NOT NULL,
  `threshhold` varchar(5) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `userId` (`userId`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `accountBalance`
--


-- --------------------------------------------------------

--
-- Table structure for table `blogPosts`
--

CREATE TABLE IF NOT EXISTS `blogPosts` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `timestamp` int(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `blogPosts`
--

INSERT INTO `blogPosts` (`id`, `timestamp`, `title`, `message`) VALUES
(4, 0, 'What we do?', '<div style="float:left;">\r\n<iframe width="360" height="224" src="http://www.youtube.com/embed/Um63OQz3bjo" fra
meborder="0" allowfullscreen></iframe>\r\n</div>\r\n<div style="padding:1em 1em 1em 1em;">\r\nFirst off welcome to the "Mining Farm" yo
u can run your computer to mine an Internet Commodity known as "Bitcoins". These <i>Bitcoins</i> can be used to purchase many things su
ch as Alpaca socks, Webhosting, or even VOIP phone services, the list goes on.<br/><br/>\r\n\r\nWikipedia explains bitcoins a little bi
t better by stating: Bitcoin enables rapid payments (and micropayments) at very low cost, and avoids the need for central authorities a
nd issuers. Digitally signed transactions, with one node signing over some amount of the currency to another node, are broadcast to all
 nodes in a peer-to-peer network. A proof-of-work system is used as measurement against double-spending and initial currency distributi
on mechanism.<br/>\r\n<a href="http://en.wikipedia.org/wiki/Bitcoin" target="_BLANK">WikiePedia Source</a>\r\n</div>');

-- --------------------------------------------------------

--
-- Table structure for table `donationList`
--

CREATE TABLE IF NOT EXISTS `donationList` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `locked` int(1) NOT NULL,
  `display` varchar(255) NOT NULL,
  `bitcoinAddress` varchar(255) NOT NULL,
  `coinAddresstype` int(3) NOT NULL COMMENT '1=Bitcoin donation address; 2 = namecoind donation address',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `donationList`
--

INSERT INTO `donationList` (`id`, `locked`, `display`, `bitcoinAddress`, `coinAddresstype`) VALUES
(2, 1, 'Mining Farm (The software this website runs off of)', 'MwSnUuXvrsfa35BSGMhUymtWUkXKSnJie9', 2),
(3, 1, 'Mining Farm (The website software you are using)', '1Fc2ScswXAHPUgj3qzmbRmwWJSLL2yv8Q', 1),
(4, 1, 'RedCross', '1HRQGDVYvQAkVh5xJetKeNfdKYWcx62cKt', 1);

-- --------------------------------------------------------

--
-- Table structure for table `menuAddition`
--

CREATE TABLE IF NOT EXISTS `menuAddition` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `displayTitle` varchar(255) NOT NULL,
  `url` varchar(1000) NOT NULL,
  `matches` varchar(1000) NOT NULL COMMENT 'This is for matching file names',
  `requireLogin` int(1) NOT NULL,
  `requireAdmin` int(1) NOT NULL,
  `order` int(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dumping data for table `menuAddition`
--

INSERT INTO `menuAddition` (`id`, `displayTitle`, `url`, `matches`, `requireLogin`, `requireAdmin`, `order`) VALUES
(1, 'Welcome', '/', 'index.php, /', 0, 0, 1),
(2, 'Account Details', '/accountDetails.php', '/accountDetails.php', 1, 0, 3),
(3, 'Statistics', '/stats.php', '/stats.php', 0, 0, 2),
(4, 'Administration', '/adminPanel.php', '/adminPanel.php', 1, 1, 4),
(5, 'User Privileges', '/adminPanel.php?show=editUsers', '/adminPanel.php?show=editUsers', 1, 1, 5),
(6, 'Workers', '/workers.php', '/workers.php', 1, 0, 7),
(11, 'Blog Editor', '/adminPanel.php?show=blogEditor', '/adminPanel.php?show=blogEditor', 1, 1, 12);

-- --------------------------------------------------------

--
-- Table structure for table `networkBlocks`
--

CREATE TABLE IF NOT EXISTS `networkBlocks` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `blockNumber` int(255) NOT NULL,
  `timestamp` int(255) NOT NULL,
  `txid` varchar(255) NOT NULL,
  `confirms` int(255) NOT NULL,
  `orphan` int(1) NOT NULL,
  `serverFeeCollected` int(1) NOT NULL COMMENT 'Lets blockFound.php know that the server fee was collected from this block to prevent m
ultiple server fee collections',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=400 ;

--
-- Dumping data for table `networkBlocks`
--
-- --------------------------------------------------------

--
-- Table structure for table `pool_worker`
--

CREATE TABLE IF NOT EXISTS `pool_worker` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `associatedUserId` int(255) NOT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `pool_worker`
--

-- --------------------------------------------------------

--
-- Table structure for table `shares`
--

CREATE TABLE IF NOT EXISTS `shares` (
  `id` bigint(30) NOT NULL AUTO_INCREMENT,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `epochTimestamp` int(50) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') DEFAULT NULL,
  `reason` varchar(50) DEFAULT NULL,
  `solution` varchar(257) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41452 ;

--
-- Dumping data for table `shares`
--
-- --------------------------------------------------------

--
-- Table structure for table `shares_dead`
--

CREATE TABLE IF NOT EXISTS `shares_dead` (
  `id` bigint(30) NOT NULL AUTO_INCREMENT,
  `blockNumber` int(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') DEFAULT NULL,
  `reason` varchar(50) DEFAULT NULL,
  `solution` varchar(257) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `shares_dead`
--


-- --------------------------------------------------------

--
-- Table structure for table `shares_history`
--

CREATE TABLE IF NOT EXISTS `shares_history` (
  `id` bigint(30) NOT NULL AUTO_INCREMENT,
  `shareCounted` int(1) NOT NULL,
  `blockNumber` int(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `rem_host` varchar(255) NOT NULL,
  `username` varchar(120) NOT NULL,
  `our_result` enum('Y','N') NOT NULL,
  `upstream_result` enum('Y','N') DEFAULT NULL,
  `reason` varchar(50) DEFAULT NULL,
  `solution` varchar(257) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `shares_history`
--


-- --------------------------------------------------------

--
-- Table structure for table `stats_bitcoinConversionHistory`
--

CREATE TABLE IF NOT EXISTS `stats_bitcoinConversionHistory` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `tradehill` varchar(25) NOT NULL,
  `mtgox` int(5) NOT NULL,
  `timestamp` int(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=842 ;

--
-- Dumping data for table `stats_bitcoinConversionHistory`
--

-- --------------------------------------------------------

--
-- Table structure for table `stats_poolMHashHistory`
--

CREATE TABLE IF NOT EXISTS `stats_poolMHashHistory` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `totalMhash` varchar(50) NOT NULL,
  `averageMhash` varchar(20) NOT NULL,
  `totalValidShares` int(255) NOT NULL,
  `timestamp` int(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6538 ;

--
-- Dumping data for table `stats_poolMHashHistory`
--

-- --------------------------------------------------------

--
-- Table structure for table `stats_topHashers`
--

CREATE TABLE IF NOT EXISTS `stats_topHashers` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `userId` int(255) NOT NULL,
  `totalHashes` int(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;

--
-- Dumping data for table `stats_topHashers`
--

INSERT INTO `stats_topHashers` (`id`, `userId`, `totalHashes`) VALUES
(31, 5, 63);

-- --------------------------------------------------------

--
-- Table structure for table `stats_topSharers`
--

CREATE TABLE IF NOT EXISTS `stats_topSharers` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `userId` varchar(255) NOT NULL,
  `shares` int(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=240 ;

--
-- Dumping data for table `stats_topSharers`
--
'7', 0);

-- --------------------------------------------------------

--
-- Table structure for table `stats_userMHashHistory`
--

CREATE TABLE IF NOT EXISTS `stats_userMHashHistory` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `mhashes` varchar(20) NOT NULL,
  `efficiency` varchar(5) NOT NULL,
  `timestamp` int(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=18471 ;

--
-- Dumping data for table `stats_userMHashHistory`
--

-- --------------------------------------------------------

--
-- Table structure for table `websiteSettings`
--

CREATE TABLE IF NOT EXISTS `websiteSettings` (
  `noreplyEmail` text NOT NULL,
  `confirmEmailPrefix` text NOT NULL COMMENT 'The text or HTML written email that is sent for email confirmation',
  `browserTitle` varchar(255) NOT NULL,
  `cashoutMinimum` varchar(5) NOT NULL COMMENT 'The minimum balance required before a user can cash out',
  `serverFeePercentage` varchar(20) NOT NULL COMMENT 'Server fee in percents',
  `serverFeeRemoteAddress` varchar(255) NOT NULL COMMENT 'This will house any server fees',
  `serverFeeAccountBalance` varchar(255) NOT NULL,
  `tradeHillWorth` varchar(20) NOT NULL COMMENT 'Current worth of bitcoins',
  `mtgoxWorth` varchar(10) NOT NULL,
  `currencyData` varchar(20) NOT NULL COMMENT 'Three letter identifiers what the general default currency should be set too',
  `stats_showallusers` int(1) NOT NULL COMMENT 'Although not recommended for commerical sites it is very usefull for private pools',
  `enableRequiredEmail` int(1) NOT NULL COMMENT 'Boolean for enabled emails to be authorized',
  `coinType` int(3) NOT NULL COMMENT '1=Bitcoin website; 2 = namecoind website'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `websiteSettings`
--

INSERT INTO `websiteSettings` (`noreplyEmail`, `confirmEmailPrefix`, `browserTitle`, `cashoutMinimum`, `serverFeePercentage`, `serverFe
eRemoteAddress`, `serverFeeAccountBalance`, `tradeHillWorth`, `mtgoxWorth`, `currencyData`, `stats_showallusers`, `enableRequiredEmail`
, `coinType`) VALUES
('noreply@noreply.com', 'Welcome to the Pool, You must activate your account before we can progress you any further. Click the link bel
ow and type in your credentials(if necessary) then we should be able to activate your account from there and start mining miners. :)\\n
', 'Mining Farm Official Vendor website', '0.02', '1', '', '211', '13.55', '0', 'btc', 1, 0, 2);

-- --------------------------------------------------------

--
-- Table structure for table `websiteUsers`
--

CREATE TABLE IF NOT EXISTS `websiteUsers` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `isAdmin` int(1) NOT NULL,
  `disabled` int(1) NOT NULL DEFAULT '0',
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `randomSecret` varchar(10) NOT NULL COMMENT 'Generated at login, this secret secures cookies when hashing',
  `sessTimestamp` int(255) NOT NULL COMMENT 'Session timestamp for valid cookie checking',
  `loggedIp` varchar(255) NOT NULL COMMENT 'Validating hashed cookies',
  `email` varchar(255) NOT NULL,
  `emailAuthorised` int(1) NOT NULL DEFAULT '0',
  `emailAuthorisePin` varchar(64) NOT NULL,
  `authPin` varchar(255) NOT NULL COMMENT 'A pin that must be supplied when changing details to various things',
  `failedLoginAttempts` int(5) NOT NULL,
  `failedLoginTimestampLock` int(255) NOT NULL COMMENT 'Epoch time until user is allowed access to page',
  `apiToken` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `websiteUsers`
--

dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
July 24, 2011, 05:41:26 PM
 #13

I take no credit for any of the above.  I just added an ID column to the miner table and a timestamp in the shares in the above post.  


Which is wrong in every possible way.
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 24, 2011, 06:07:11 PM
 #14

adding an id is wrong?

or a timestamp?


for what reason?

Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
July 24, 2011, 07:09:18 PM
 #15

Also, not to brag, but i was the one who gave the table structure to xenland when he first started developing "miningFarm". Altho, this one, you posted differs.

Man that brings back memories of me staying up for 10 hours up into the morning trying to "crack" the un-documented pushpoold database...... Thanks Diki!
dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
July 24, 2011, 07:20:23 PM
 #16

adding an id is wrong?

or a timestamp?


for what reason?


The timestamp field is correct as far as i can see, as for the ID field..yeah, that's not. But i am going to let you fix it yourself and help you learn where you were wrong.

Also, not to brag, but i was the one who gave the table structure to xenland when he first started developing "miningFarm". Altho, this one, you posted differs.

Man that brings back memories of me staying up for 10 hours up into the morning trying to "crack" the un-documented pushpoold database...... Thanks Diki!
Wink
Flowz (OP)
Member
**
Offline Offline

Activity: 114
Merit: 10


Bitcoin = Money for the people, by the people.


View Profile
July 24, 2011, 07:38:19 PM
 #17

I corrected them, btw MiningFarm uses 257 instead the 256 you mentioned?
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 24, 2011, 08:11:12 PM
 #18

The timestamp field is correct as far as i can see, as for the ID field..yeah, that's not. But i am going to let you fix it yourself and help you learn where you were wrong.

You're going to need to enlighten me.  I realize the username field (must be) unique, but I can't envision developing a system where I want to look at a table or a couple of tables and associate only on something like username.  Integer lookup is just better.  Associating two tables with ID numbers is normal, why is this different?

And, in the code included with mining farm there is, in fact, an ID column in the pool_worker table.  Two of em.  So how is it wrong?






dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
July 24, 2011, 09:55:20 PM
 #19

The timestamp field is correct as far as i can see, as for the ID field..yeah, that's not. But i am going to let you fix it yourself and help you learn where you were wrong.

You're going to need to enlighten me.  I realize the username field (must be) unique, but I can't envision developing a system where I want to look at a table or a couple of tables and associate only on something like username.  Integer lookup is just better.  Associating two tables with ID numbers is normal, why is this different?

And, in the code included with mining farm there is, in fact, an ID column in the pool_worker table.  Two of em.  So how is it wrong?







I honestly didn't think you were smart enough to use table association, i give you that. For the latter, cause it needs to be auto_increment, but most importantly, should NOT have a default value.
Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
July 24, 2011, 10:00:15 PM
 #20

* Viceroy chuckles
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!