34148-vm/db/migrations/004_create_jobs_table.php
2025-09-17 15:46:15 +00:00

28 lines
769 B
PHP

<?php
require_once __DIR__ . '/../config.php';
function migrate_004_create_jobs_table() {
try {
$pdo = db();
$sql = "
CREATE TABLE IF NOT EXISTS `jobs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`department` varchar(255) NOT NULL,
`location` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`description` text NOT NULL,
`requirements` json NOT NULL,
`benefits` json NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
";
$pdo->exec($sql);
echo "Migration 004: Jobs table created successfully.\n";
} catch (PDOException $e) {
die("Migration 004 failed: " . $e->getMessage() . "\n");
}
}