-- Database schema for Monthly Tombola website CREATE DATABASE IF NOT EXISTS monthly_tombola; USE monthly_tombola; -- Users table to store participant information CREATE TABLE users ( user_id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE, first_name VARCHAR(100), last_name VARCHAR(100), phone VARCHAR(20), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, is_verified BOOLEAN DEFAULT FALSE, verification_token VARCHAR(255) ) ENGINE=InnoDB; -- Draws table to store each monthly draw information CREATE TABLE draws ( draw_id INT AUTO_INCREMENT PRIMARY KEY, draw_date DATE NOT NULL, prize_pot DECIMAL(12,2) DEFAULT 0.00, ticket_price DECIMAL(6,2) NOT NULL DEFAULT 10.00, is_completed BOOLEAN DEFAULT FALSE, completed_at TIMESTAMP NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB; -- Tickets table to track all purchased tickets CREATE TABLE tickets ( ticket_id INT AUTO_INCREMENT PRIMARY KEY, draw_id INT NOT NULL, user_id INT NOT NULL, ticket_number VARCHAR(20) NOT NULL, purchase_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, payment_id INT, FOREIGN KEY (draw_id) REFERENCES draws(draw_id), FOREIGN KEY (user_id) REFERENCES users(user_id), INDEX (ticket_number), INDEX (draw_id, user_id) ) ENGINE=InnoDB; -- Payments table to track all transactions CREATE TABLE payments ( payment_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, amount DECIMAL(12,2) NOT NULL, currency VARCHAR(3) DEFAULT 'USD', payment_method ENUM('stripe', 'paypal', 'other') NOT NULL, transaction_id VARCHAR(255), status ENUM('pending', 'completed', 'failed', 'refunded') DEFAULT 'pending', payment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id), INDEX (transaction_id), INDEX (user_id, status) ) ENGINE=InnoDB; -- Winners table to store draw winners CREATE TABLE winners ( winner_id INT AUTO_INCREMENT PRIMARY KEY, draw_id INT NOT NULL, user_id INT NOT NULL, ticket_id INT NOT NULL, prize_amount DECIMAL(12,2) NOT NULL, claimed BOOLEAN DEFAULT FALSE, claimed_at TIMESTAMP NULL, payment_method VARCHAR(50), payment_details TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (draw_id) REFERENCES draws(draw_id), FOREIGN KEY (user_id) REFERENCES users(user_id), FOREIGN KEY (ticket_id) REFERENCES tickets(ticket_id), INDEX (draw_id, user_id) ) ENGINE=InnoDB; -- User sessions table CREATE TABLE user_sessions ( session_id VARCHAR(255) PRIMARY KEY, user_id INT NOT NULL, ip_address VARCHAR(45), user_agent TEXT, expires_at TIMESTAMP NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id), INDEX (user_id, expires_at) ) ENGINE=InnoDB; -- Audit log for important actions CREATE TABLE audit_log ( log_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, action VARCHAR(50) NOT NULL, description TEXT, ip_address VARCHAR(45), user_agent TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id) ) ENGINE=InnoDB; -- Payment methods table CREATE TABLE payment_methods ( method_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, method_type ENUM('card', 'paypal', 'bank') NOT NULL, details JSON, is_default BOOLEAN DEFAULT FALSE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id), INDEX (user_id, method_type) ) ENGINE=InnoDB; -- Add initial data (current month's draw) INSERT INTO draws (draw_date, ticket_price) VALUES (LAST_DAY(CURRENT_DATE()), 10.00); Monthly Tombola - Win Big Every Month!
Next Draw:

Win 80% of the Pot Every Month!

Buy your tickets now for a chance to win the monthly prize. 80% goes to the winner, 20% is our commission.

Current Monthly Draw

$5,420
Current Prize Pot
80% to winner (≈ $4,336)
542
Tickets Sold
$10 per ticket
14
Days Remaining
Draw on June 30, 2023

How It Works

1

Buy Tickets

Purchase tickets for $10 each. Each ticket gives you one entry into the monthly draw.

2

Wait for Draw

The draw happens automatically on the last day of each month at midnight UTC.

3

Win Big!

One lucky winner gets 80% of the total pot. We keep 20% as commission.

Previous Winners

WINNER
JD

John D.

May 2023

$3,840

"I couldn't believe it when I won! The money was in my account within 24 hours."

WINNER
SM

Sarah M.

April 2023

$2,960

"This came at the perfect time. I used the money to pay off some medical bills."

WINNER
RK

Robert K.

March 2023

$4,120

"I bought just one ticket on a whim. Best $10 I ever spent!"

Buy Tickets

Select Number of Tickets

Tickets: 0
Price per ticket: $10.00
Total: $0.00

Choose Payment Method

Credit/Debit Card

PayPal

Frequently Asked Questions