rendered paste body-- phpMyAdmin SQL Dump
-- version 2.11.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 10, 2008 at 02:39 PM
-- Server version: 5.0.45
-- PHP Version: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `staking`
--
-- --------------------------------------------------------
--
-- Table structure for table `balanced_transfer`
--
CREATE TABLE `balanced_transfer` (
`id` int(11) NOT NULL auto_increment,
`amount` double default NULL,
`created_at` datetime default NULL,
`user_id` int(11) default NULL,
`is_complete` tinyint(1) default '0',
`direction` int(11) default NULL,
PRIMARY KEY (`id`),
KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `balanced_transfer`
--
INSERT INTO `balanced_transfer` (`id`, `amount`, `created_at`, `user_id`, `is_complete`, `direction`) VALUES
(1, 1000, '2008-03-09 15:02:15', 3, 1, 0),
(2, 1000, '2008-03-09 15:02:17', 3, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `balanced_transfer_component`
--
CREATE TABLE `balanced_transfer_component` (
`id` int(11) NOT NULL auto_increment,
`balanced_transfer_id` int(11) default NULL,
`player_transfer_id` int(11) default NULL,
`amount` double NOT NULL,
PRIMARY KEY (`id`),
KEY `balanced_transfer_id_idx` (`balanced_transfer_id`),
KEY `player_transfer_id_idx` (`player_transfer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `balanced_transfer_component`
--
INSERT INTO `balanced_transfer_component` (`id`, `balanced_transfer_id`, `player_transfer_id`, `amount`) VALUES
(1, 1, 6, -1000),
(2, 1, 7, 300),
(3, 1, 8, 700),
(4, 2, 14, -1000);
-- --------------------------------------------------------
--
-- Table structure for table `player`
--
CREATE TABLE `player` (
`id` int(11) NOT NULL auto_increment,
`screenname` varchar(32) NOT NULL,
`site_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`staking_balance` double NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id_idx` (`user_id`),
KEY `site_id_idx` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `player`
--
INSERT INTO `player` (`id`, `screenname`, `site_id`, `user_id`, `staking_balance`) VALUES
(1, 'DankStax21', 1, 3, 6000),
(2, 'DankStax987', 2, 3, 6100),
(3, 'DankStax7777', 3, 3, 700),
(4, 'AdminFT', 1, 1, 0),
(5, 'AdminPS', 2, 1, 0),
(6, 'AdminUB', 3, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `player_transaction`
--
CREATE TABLE `player_transaction` (
`id` int(11) NOT NULL auto_increment,
`player_id` int(11) NOT NULL,
`notes` text,
`amount` double NOT NULL,
`type` int(11) default NULL,
`created_at` datetime NOT NULL,
`is_broken` tinyint(1) default '0',
PRIMARY KEY (`id`),
KEY `player_id_idx` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
--
-- Dumping data for table `player_transaction`
--
INSERT INTO `player_transaction` (`id`, `player_id`, `notes`, `amount`, `type`, `created_at`, `is_broken`) VALUES
(1, 5, NULL, -500, 2, '2008-01-04 00:00:00', 1),
(2, 2, NULL, 500, 1, '2008-01-04 00:00:00', 1),
(3, 4, NULL, -2500, 2, '2008-01-05 00:00:00', 1),
(4, 1, NULL, 2500, 1, '2008-01-05 00:00:00', 1),
(5, 5, NULL, -4500, 2, '2008-01-03 00:00:00', 1),
(6, 2, NULL, 4500, 1, '2008-01-03 00:00:00', 1),
(7, 5, NULL, -500, 2, '2008-01-02 00:00:00', 1),
(8, 2, NULL, 500, 1, '2008-01-02 00:00:00', 1),
(9, 2, NULL, -200, 2, '2008-01-04 00:00:00', 1),
(10, 5, NULL, 200, 1, '2008-01-04 00:00:00', 1),
(11, 1, NULL, -1000, 2, '2007-12-01 00:00:00', 1),
(12, 4, NULL, 1000, 1, '2007-12-01 00:00:00', 1),
(13, 5, NULL, -500, 2, '2007-12-02 00:00:00', 1),
(14, 2, NULL, 500, 1, '2007-12-02 00:00:00', 1),
(15, 5, NULL, -700, 2, '2007-12-03 00:00:00', 1),
(16, 2, NULL, 700, 1, '2007-12-03 00:00:00', 1),
(17, 2, NULL, -200, 2, '2008-01-02 00:00:00', 1),
(18, 5, NULL, 200, 1, '2008-01-02 00:00:00', 1),
(19, 5, NULL, -200, 2, '2008-01-01 00:00:00', 1),
(20, 2, NULL, 200, 1, '2008-01-01 00:00:00', 1),
(21, 6, NULL, -700, 2, '2008-01-04 00:00:00', 1),
(22, 3, NULL, 700, 1, '2008-01-04 00:00:00', 1),
(23, 4, NULL, -4500, 2, '2008-01-05 00:00:00', 1),
(24, 1, NULL, 4500, 1, '2008-01-05 00:00:00', 1),
(25, 2, NULL, -400, 2, '2008-01-06 00:00:00', 1),
(26, 5, NULL, 400, 1, '2008-01-06 00:00:00', 1),
(27, 3, NULL, 0, 0, '2007-12-29 19:00:00', 1),
(28, 1, NULL, -1000, 2, '2008-02-21 00:00:00', 1),
(29, 4, NULL, 1000, 1, '2008-02-21 00:00:00', 1);
-- --------------------------------------------------------
--
-- Table structure for table `player_transaction_breakdown`
--
CREATE TABLE `player_transaction_breakdown` (
`id` int(11) NOT NULL auto_increment,
`amount` double default NULL,
`player_transaction_id` int(11) default NULL,
`type` int(11) default NULL,
PRIMARY KEY (`id`),
KEY `player_transaction_id_idx` (`player_transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=43 ;
--
-- Dumping data for table `player_transaction_breakdown`
--
INSERT INTO `player_transaction_breakdown` (`id`, `amount`, `player_transaction_id`, `type`) VALUES
(9, -1000, 11, 4),
(10, 300, 14, 3),
(11, 200, 14, 0),
(18, 700, 16, 3),
(30, 0, 27, 2),
(31, 200, 20, 0),
(32, 500, 8, 0),
(33, -200, 17, 5),
(34, 4100, 6, 0),
(35, 400, 6, 1),
(36, 500, 2, 1),
(37, -200, 9, 6),
(38, 700, 22, 1),
(39, 2500, 4, 1),
(40, 4500, 24, 1),
(41, -400, 25, 6),
(42, -1000, 28, 4);
-- --------------------------------------------------------
--
-- Table structure for table `player_transfer`
--
CREATE TABLE `player_transfer` (
`id` int(11) NOT NULL auto_increment,
`amount` double NOT NULL,
`transaction_in` int(11) NOT NULL,
`transaction_out` int(11) NOT NULL,
`player_in` int(11) NOT NULL,
`player_out` int(11) NOT NULL,
`created_at` datetime default NULL,
`balanced_component_total` double NOT NULL,
PRIMARY KEY (`id`),
KEY `transaction_in_idx` (`transaction_in`),
KEY `transaction_out_idx` (`transaction_out`),
KEY `player_in_idx` (`player_in`),
KEY `player_out_idx` (`player_out`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
--
-- Dumping data for table `player_transfer`
--
INSERT INTO `player_transfer` (`id`, `amount`, `transaction_in`, `transaction_out`, `player_in`, `player_out`, `created_at`, `balanced_component_total`) VALUES
(1, 500, 2, 1, 2, 5, '2008-03-09 15:02:14', 0),
(2, 2500, 4, 3, 1, 4, '2008-03-09 15:02:14', 0),
(3, 4500, 6, 5, 2, 5, '2008-03-09 15:02:15', 0),
(4, 500, 8, 7, 2, 5, '2008-03-09 15:02:15', 0),
(5, 200, 10, 9, 5, 2, '2008-03-09 15:02:15', 0),
(6, 1000, 12, 11, 4, 1, '2008-03-09 15:02:15', 0),
(7, 500, 14, 13, 2, 5, '2008-03-09 15:02:15', 0),
(8, 700, 16, 15, 2, 5, '2008-03-09 15:02:15', 0),
(9, 200, 18, 17, 5, 2, '2008-03-09 15:02:16', 0),
(10, 200, 20, 19, 2, 5, '2008-03-09 15:02:16', 0),
(11, 700, 22, 21, 3, 6, '2008-03-09 15:02:16', 0),
(12, 4500, 24, 23, 1, 4, '2008-03-09 15:02:16', 0),
(13, 400, 26, 25, 5, 2, '2008-03-09 15:02:16', 0),
(14, 1000, 29, 28, 4, 1, '2008-03-09 15:02:17', 0);
-- --------------------------------------------------------
--
-- Table structure for table `tournament`
--
CREATE TABLE `tournament` (
`id` int(11) NOT NULL auto_increment,
`site_id` int(11) NOT NULL,
`date` datetime NOT NULL,
`buyin_id` int(11) NOT NULL,
`allows_rebuy` tinyint(1) default '0',
`allows_addon` tinyint(1) default '0',
`added_by` int(11) NOT NULL,
`cron_id` int(11) default NULL,
PRIMARY KEY (`id`),
KEY `added_by_idx` (`added_by`),
KEY `site_id_idx` (`site_id`),
KEY `buyin_id_idx` (`buyin_id`),
KEY `cron_id_idx` (`cron_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Dumping data for table `tournament`
--
INSERT INTO `tournament` (`id`, `site_id`, `date`, `buyin_id`, `allows_rebuy`, `allows_addon`, `added_by`, `cron_id`) VALUES
(1, 1, '2007-12-29 19:00:00', 1, 0, 0, 1, NULL),
(2, 1, '2008-01-01 19:00:00', 2, 1, 1, 1, NULL),
(3, 1, '2007-12-01 18:30:00', 2, 1, 1, 1, NULL),
(4, 2, '2007-12-29 19:00:00', 6, 0, 0, 1, NULL),
(5, 2, '2008-01-01 19:00:00', 7, 1, 1, 1, NULL),
(6, 2, '2007-12-01 18:30:00', 7, 1, 1, 1, NULL),
(7, 3, '2007-12-29 19:00:00', 10, 0, 0, 1, NULL),
(8, 3, '2008-01-01 19:00:00', 11, 1, 1, 1, NULL),
(9, 3, '2007-12-01 18:30:00', 11, 1, 1, 1, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tournament_cron`
--
CREATE TABLE `tournament_cron` (
`id` int(11) NOT NULL auto_increment,
`on_monday` tinyint(1) default NULL,
`on_tuesday` tinyint(1) default NULL,
`on_wednesday` tinyint(1) default NULL,
`on_thursday` tinyint(1) default NULL,
`on_friday` tinyint(1) default NULL,
`on_saturday` tinyint(1) default NULL,
`on_sunday` tinyint(1) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `tournament_cron`
--
-- --------------------------------------------------------
--
-- Table structure for table `tournament_player_link`
--
CREATE TABLE `tournament_player_link` (
`id` int(11) NOT NULL auto_increment,
`tournament_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`rebuys` bigint(20) default NULL,
`payout` bigint(20) default NULL,
`bounty` bigint(20) default '0',
`transaction_id` int(11) default NULL,
`is_approved` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `player_id_idx` (`player_id`),
KEY `tournament_id_idx` (`tournament_id`),
KEY `transaction_id_idx` (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `tournament_player_link`
--
INSERT INTO `tournament_player_link` (`id`, `tournament_id`, `player_id`, `rebuys`, `payout`, `bounty`, `transaction_id`, `is_approved`) VALUES
(1, 7, 3, 100, 834, 0, 27, 0);
-- --------------------------------------------------------
--
-- Table structure for table `tournament_site`
--
CREATE TABLE `tournament_site` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`allows_p2p` tinyint(1) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `tournament_site`
--
INSERT INTO `tournament_site` (`id`, `name`, `allows_p2p`) VALUES
(1, 'Full Tilt', 1),
(2, 'PokerStars', 1),
(3, 'Ultimate Bet', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tournament_site_buyin`
--
CREATE TABLE `tournament_site_buyin` (
`id` int(11) NOT NULL auto_increment,
`site_id` int(11) NOT NULL,
`buyin` bigint(20) NOT NULL,
`rake` bigint(20) NOT NULL,
`active` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `site_id_idx` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;
--
-- Dumping data for table `tournament_site_buyin`
--
INSERT INTO `tournament_site_buyin` (`id`, `site_id`, `buyin`, `rake`, `active`) VALUES
(1, 1, 50, 5, 1),
(2, 1, 100, 9, 1),
(3, 1, 200, 15, 1),
(4, 1, 500, 20, 1),
(5, 2, 10, 1, 1),
(6, 2, 50, 5, 1),
(7, 2, 100, 9, 1),
(8, 2, 200, 15, 1),
(9, 2, 500, 20, 1),
(10, 3, 50, 5, 1),
(11, 3, 100, 9, 1),
(12, 3, 200, 15, 1),
(13, 3, 500, 20, 1),
(14, 2, 30, 3, 1),
(15, 1, 69, 6, 1),
(16, 1, 150, 13, 1),
(17, 3, 120, 9, 1),
(18, 2, 150, 12, 1),
(19, 2, 20, 2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL auto_increment,
`display_name` varchar(255) NOT NULL,
`username` varchar(32) NOT NULL,
`password` varchar(32) default NULL,
`is_admin` tinyint(1) default '0',
`is_coach` tinyint(1) default '0',
`is_player` tinyint(1) default '1',
`remember_hash` varchar(32) default NULL,
`bankroll` double default NULL,
`chop_threshold` int(11) default NULL,
`staking_deal` double default NULL,
`staking_balance` double NOT NULL,
`makeup` double NOT NULL,
`created_at` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `display_name`, `username`, `password`, `is_admin`, `is_coach`, `is_player`, `remember_hash`, `bankroll`, `chop_threshold`, `staking_deal`, `staking_balance`, `makeup`, `created_at`) VALUES
(1, 'Administrator', 'admin', 'admin', 1, 0, 0, NULL, NULL, NULL, NULL, 0, 0, '2008-03-09 15:01:57'),
(2, 'JLewis', 'jlewis', 'jlewis', 0, 0, 1, NULL, 5000, 5000, 50, 0, 0, '2008-03-09 15:01:57'),
(3, 'Dank Stax', 'dank', 'dank', 0, 0, 1, NULL, 5000, 5000, 40, 12800, 8000, '2008-03-09 15:01:57'),
(4, 'ZBThornton', 'zbt', 'zbt', 0, 0, 1, NULL, 5000, 5000, 50, 0, 0, '2008-03-09 15:01:57'),
(5, 'Kush Patel', 'kush', 'kush', 0, 1, 0, NULL, NULL, NULL, NULL, 0, 0, '2008-03-09 15:01:57'),
(6, 'Carl Olsen', 'carl', 'carl', 0, 1, 0, NULL, NULL, NULL, NULL, 0, 0, '2008-03-09 15:01:57');
-- --------------------------------------------------------
--
-- Table structure for table `videos`
--
CREATE TABLE `videos` (
`id` int(11) NOT NULL auto_increment,
`date` datetime NOT NULL,
`site_id` int(11) NOT NULL,
`title` varchar(200) default NULL,
`user_id` int(11) NOT NULL,
`buyin_id` int(11) NOT NULL,
`is_rebuy` tinyint(1) NOT NULL default '0',
`coach_id` int(11) NOT NULL,
`url` text,
PRIMARY KEY (`id`),
KEY `user_id_idx` (`user_id`),
KEY `coach_id_idx` (`coach_id`),
KEY `site_id_idx` (`site_id`),
KEY `buyin_id_idx` (`buyin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `videos`
--
INSERT INTO `videos` (`id`, `date`, `site_id`, `title`, `user_id`, `buyin_id`, `is_rebuy`, `coach_id`, `url`) VALUES
(1, '2007-12-02 12:00:00', 2, NULL, 3, 8, 0, 5, 'http://www.pokerxfactor.com/HA101322/31764_20071207_203728/31764'),
(2, '2000-01-13 12:00:00', 2, 'Sunday Mil', 2, 8, 0, 5, 'http://www.pokerxfactor.com/HA109468/31764_20080118_023642/31764'),
(3, '2007-12-03 12:00:00', 2, NULL, 2, 7, 0, 6, 'http://www.pokerxfactor.com/HA109468/31764_20080118_023642/31764'),
(4, '2008-01-20 12:00:00', 2, NULL, 2, 5, 1, 5, 'http://www.pokerxfactor.com/HA110608/31764_20080123_184546/31764');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `balanced_transfer`
--
ALTER TABLE `balanced_transfer`
ADD CONSTRAINT `balanced_transfer_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `balanced_transfer_component`
--
ALTER TABLE `balanced_transfer_component`
ADD CONSTRAINT `balanced_transfer_component_ibfk_2` FOREIGN KEY (`balanced_transfer_id`) REFERENCES `balanced_transfer` (`id`),
ADD CONSTRAINT `balanced_transfer_component_ibfk_1` FOREIGN KEY (`player_transfer_id`) REFERENCES `player_transfer` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player`
--
ALTER TABLE `player`
ADD CONSTRAINT `player_ibfk_2` FOREIGN KEY (`site_id`) REFERENCES `tournament_site` (`id`),
ADD CONSTRAINT `player_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `player_transaction`
--
ALTER TABLE `player_transaction`
ADD CONSTRAINT `player_transaction_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `player` (`id`);
--
-- Constraints for table `player_transaction_breakdown`
--
ALTER TABLE `player_transaction_breakdown`
ADD CONSTRAINT `player_transaction_breakdown_ibfk_1` FOREIGN KEY (`player_transaction_id`) REFERENCES `player_transaction` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_transfer`
--
ALTER TABLE `player_transfer`
ADD CONSTRAINT `player_transfer_ibfk_4` FOREIGN KEY (`player_in`) REFERENCES `player` (`id`),
ADD CONSTRAINT `player_transfer_ibfk_1` FOREIGN KEY (`transaction_out`) REFERENCES `player_transaction` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `player_transfer_ibfk_2` FOREIGN KEY (`transaction_in`) REFERENCES `player_transaction` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `player_transfer_ibfk_3` FOREIGN KEY (`player_out`) REFERENCES `player` (`id`);
--
-- Constraints for table `tournament`
--
ALTER TABLE `tournament`
ADD CONSTRAINT `tournament_ibfk_4` FOREIGN KEY (`added_by`) REFERENCES `user` (`id`),
ADD CONSTRAINT `tournament_ibfk_1` FOREIGN KEY (`site_id`) REFERENCES `tournament_site` (`id`),
ADD CONSTRAINT `tournament_ibfk_2` FOREIGN KEY (`cron_id`) REFERENCES `tournament_cron` (`id`),
ADD CONSTRAINT `tournament_ibfk_3` FOREIGN KEY (`buyin_id`) REFERENCES `tournament_site_buyin` (`id`);
--
-- Constraints for table `tournament_player_link`
--
ALTER TABLE `tournament_player_link`
ADD CONSTRAINT `tournament_player_link_ibfk_3` FOREIGN KEY (`player_id`) REFERENCES `player` (`id`),
ADD CONSTRAINT `tournament_player_link_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `player_transaction` (`id`),
ADD CONSTRAINT `tournament_player_link_ibfk_2` FOREIGN KEY (`tournament_id`) REFERENCES `tournament` (`id`);
--
-- Constraints for table `tournament_site_buyin`
--
ALTER TABLE `tournament_site_buyin`
ADD CONSTRAINT `tournament_site_buyin_ibfk_1` FOREIGN KEY (`site_id`) REFERENCES `tournament_site` (`id`);
--
-- Constraints for table `videos`
--
ALTER TABLE `videos`
ADD CONSTRAINT `videos_ibfk_4` FOREIGN KEY (`buyin_id`) REFERENCES `tournament_site_buyin` (`id`),
ADD CONSTRAINT `videos_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `videos_ibfk_2` FOREIGN KEY (`site_id`) REFERENCES `tournament_site` (`id`),
ADD CONSTRAINT `videos_ibfk_3` FOREIGN KEY (`coach_id`) REFERENCES `user` (`id`);