HTML estilizadov10Sem dependência externa

Banco de dados — Trabalhe Conosco

Documento gerado a partir dos arquivos SQL do projeto. Não inclui senhas, dados reais nem dumps de produção.

users

Campo Definição
id INT UNSIGNED NOT NULL AUTO_INCREMENT
name VARCHAR(140) NOT NULL
email VARCHAR(180) NOT NULL
password_hash VARCHAR(255) NOT NULL
role ENUM('admin','rh') NOT NULL DEFAULT 'rh'
active TINYINT(1) NOT NULL DEFAULT 1
last_login_at DATETIME NULL
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • UNIQUE KEY users_email_unique (email)
  • KEY users_role_active_idx (role, active)

units

Campo Definição
id INT UNSIGNED NOT NULL AUTO_INCREMENT
external_id INT UNSIGNED NULL
name VARCHAR(160) NOT NULL
active TINYINT(1) NOT NULL DEFAULT 1
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • UNIQUE KEY units_external_id_unique (external_id)
  • KEY units_active_name_idx (active, name)

positions

Campo Definição
id INT UNSIGNED NOT NULL AUTO_INCREMENT
title VARCHAR(160) NOT NULL
active TINYINT(1) NOT NULL DEFAULT 1
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • UNIQUE KEY positions_title_unique (title)
  • KEY positions_active_title_idx (active, title)

candidates

Campo Definição
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
uuid CHAR(36) NOT NULL
nome_completo VARCHAR(180) NOT NULL
email VARCHAR(180) NOT NULL
telefone VARCHAR(40) NOT NULL
data_nascimento DATE NULL
cidade VARCHAR(120) NULL
estado CHAR(2) NULL
unidade_id INT UNSIGNED NULL
cargo_id INT UNSIGNED NULL
pretensao_salarial DECIMAL(10,2) NULL
disponibilidade VARCHAR(120) NULL
linkedin VARCHAR(255) NULL
portfolio VARCHAR(255) NULL
origem VARCHAR(120) NULL
experiencia TEXT NOT NULL
status VARCHAR(40) NOT NULL DEFAULT 'novo'
curriculo_original VARCHAR(255) NULL
curriculo_path VARCHAR(255) NULL
curriculo_mime VARCHAR(120) NULL
curriculo_size INT UNSIGNED NULL
lgpd_consentimento TINYINT(1) NOT NULL DEFAULT 0
ip_hash CHAR(64) NULL
user_agent VARCHAR(255) NULL
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • UNIQUE KEY candidates_uuid_unique (uuid)
  • KEY candidates_status_created_idx (status, created_at)
  • KEY candidates_created_idx (created_at)
  • KEY candidates_nome_idx (nome_completo)
  • KEY candidates_email_idx (email)
  • KEY candidates_unidade_status_idx (unidade_id, status)
  • KEY candidates_cargo_status_idx (cargo_id, status)
  • KEY candidates_curriculo_created_idx (curriculo_path, created_at)
  • KEY candidates_unidade_curriculo_idx (unidade_id, curriculo_path)
  • KEY candidates_cargo_curriculo_idx (cargo_id, curriculo_path)
  • CONSTRAINT candidates_unit_fk FOREIGN KEY (unidade_id) REFERENCES units(id) ON DELETE SET NULL
  • CONSTRAINT candidates_position_fk FOREIGN KEY (cargo_id) REFERENCES positions(id) ON DELETE SET NULL

candidate_notes

Campo Definição
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
candidate_id BIGINT UNSIGNED NOT NULL
user_id INT UNSIGNED NOT NULL
note TEXT NOT NULL
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • KEY candidate_notes_candidate_idx (candidate_id, created_at)
  • CONSTRAINT candidate_notes_candidate_fk FOREIGN KEY (candidate_id) REFERENCES candidates(id) ON DELETE CASCADE
  • CONSTRAINT candidate_notes_user_fk FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE

candidate_status_history

Campo Definição
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
candidate_id BIGINT UNSIGNED NOT NULL
user_id INT UNSIGNED NULL
status_from VARCHAR(40) NULL
status_to VARCHAR(40) NOT NULL
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP

Índices/constraints:

  • PRIMARY KEY (id)
  • KEY candidate_status_history_candidate_idx (candidate_id, created_at)
  • CONSTRAINT candidate_status_history_candidate_fk FOREIGN KEY (candidate_id) REFERENCES candidates(id) ON DELETE CASCADE
  • CONSTRAINT candidate_status_history_user_fk FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL