-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitignore
More file actions
27 lines (24 loc) · 1.06 KB
/
.gitignore
File metadata and controls
27 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
CREATE DATABASE IF NOT EXISTS mydb;
USE mydb;
CREATE TABLE IF NOT EXISTS todos (
id INT AUTO_INCREMENT PRIMARY KEY,
task VARCHAR(255) NOT NULL,
status ENUM('pending', 'completed') DEFAULT 'pending',
deleted BOOLEAN DEFAULT FALSE, -- Add for soft delete
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP NULL, -- Add for soft delete
INDEX idx_status (status),
INDEX idx_created_at (created_at),
INDEX idx_deleted (deleted) -- Add for soft delete
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Sample data
INSERT INTO todos (task, status) VALUES
('Welcome back!', 'pending'),
('Table recreated successfully', 'completed');
('Learn Docker basics', 'completed'),
('Build Flask application', 'completed'),
('Write Dockerfile', 'pending'),
('Create docker-compose.yml', 'pending'),
('Push to Docker Hub', 'pending'),
('Deploy to production', 'pending');