CREATE DATABASE IF NOT EXISTS dailycareers CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE dailycareers;

CREATE TABLE jobs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  user_id INT NOT NULL,
  heading VARCHAR(255) NOT NULL,
  company VARCHAR(255) NOT NULL,
  location VARCHAR(255) NOT NULL,
  category VARCHAR(100) NOT NULL,
  closing_date DATE NOT NULL,
  short_description VARCHAR(500) NOT NULL,
  full_description TEXT NOT NULL,
  apply_link VARCHAR(1000) NOT NULL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;