13 lines
570 B
PHP
13 lines
570 B
PHP
<?php
|
|
$pdo->exec("CREATE TABLE IF NOT EXISTS tasks (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
name VARCHAR(255) NOT NULL,
|
|
description TEXT,
|
|
project_id INT NOT NULL,
|
|
user_id INT NOT NULL,
|
|
status ENUM('created', 'in_progress', 'testing', 'complete', 'approved') DEFAULT 'created',
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
|
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
)"); |