Skip to content

db exercise JGC #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

db exercise JGC #13

wants to merge 1 commit into from

Conversation

jgallego19
Copy link

prompt 1 (claude-3.7-sonnet thinking)

Actua como un Architecto de Sistemas y DBA experto en el diseño de sistemas escalables usando DDD.

La aplicación actual es un sistema ATS en la que actualmente se pueden dar de alta candidatos, sobre los que se aportan datos básicos, experiencias laborales previas, educación y currículum vitae. Quiero ampliar el sistema con nuevas entidades que nos permitan operar el flujo completo de aplicación para diversas posiciones. Para ello, te paso el siguiente ERD en formato mermaid:

"erDiagram
COMPANY {
int id PK
string name
}
EMPLOYEE {
int id PK
int company_id FK
string name
string email
string role
boolean is_active
}
POSITION {
int id PK
int company_id FK
int interview_flow_id FK
string title
text description
string status
boolean is_visible
string location
text job_description
text requirements
text responsibilities
numeric salary_min
numeric salary_max
string employment_type
text benefits
text company_description
date application_deadline
string contact_info
}
INTERVIEW_FLOW {
int id PK
string description
}
INTERVIEW_STEP {
int id PK
int interview_flow_id FK
int interview_type_id FK
string name
int order_index
}
INTERVIEW_TYPE {
int id PK
string name
text description
}
CANDIDATE {
int id PK
string firstName
string lastName
string email
string phone
string address
}
APPLICATION {
int id PK
int position_id FK
int candidate_id FK
date application_date
string status
text notes
}
INTERVIEW {
int id PK
int application_id FK
int interview_step_id FK
int employee_id FK
date interview_date
string result
int score
text notes
}

 COMPANY ||--o{ EMPLOYEE : employs
 COMPANY ||--o{ POSITION : offers
 POSITION ||--|| INTERVIEW_FLOW : assigns
 INTERVIEW_FLOW ||--o{ INTERVIEW_STEP : contains
 INTERVIEW_STEP ||--|| INTERVIEW_TYPE : uses
 POSITION ||--o{ APPLICATION : receives
 CANDIDATE ||--o{ APPLICATION : submits
 APPLICATION ||--o{ INTERVIEW : has
 INTERVIEW ||--|| INTERVIEW_STEP : consists_of
 EMPLOYEE ||--o{ INTERVIEW : conducts"

Quiero que:

  1. Analices el ERD y generes un script de migración en Prisma para añadir a la base de datos las entidades para cubrir la funcionalidad necesaria para operar el flujo completo de aplicación para diversas posiciones.
  2. Apliques las mejores prácticas para:
  • Normalización de datos, al menos hasta la tercera forma normal
  • Creación de índices donde sea necesario, teniendo en cuenta las consultas más frecuentes

prompt 2 (claude-3.7-sonnet thinking)

Ahora quiero que me generes el script de migración, tanto de la nueva estructura del esquema de la base de datos, como de los propios datos existentes al nuevo modelo.


prompt 3 (claude-3.7-sonnet thinking)

cómo aplico el nuevo script de migración?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants