Skip to content
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

Validations #13

Merged
merged 6 commits into from
Dec 13, 2024
Merged

Validations #13

merged 6 commits into from
Dec 13, 2024

Conversation

Jrgil20
Copy link
Owner

@Jrgil20 Jrgil20 commented Dec 13, 2024

This pull request includes several changes to the commands.sql file, primarily focusing on adding new checks and constraints to ensure data integrity in the database. The most important changes include adding a new function and trigger for checking specific conditions related to tipoProductor, modifying existing data insertion statements to match new constraints, and adding a new constraint to the CANTIDAD_OFRECIDA table.

New Functions and Triggers:

  • Added check_ProductorCg function to ensure no active contract exists with the same subastadora and productora when tipoProductor is 'Cg'.
  • Created a trigger check_ProductorCg to execute the check_ProductorCg function before insert or update operations on the CONTRATO table.

Modifications to Existing Functions:

  • Updated check_ContratoActivo function to include a condition that checks tipoProductor is not 'Cg' before raising an exception. [1] [2]

Constraints and Data Integrity:

  • Added a new constraint chk_idCatalogoProductora_equals_idContratoProductora to the CANTIDAD_OFRECIDA table to ensure idCatalogoProductora matches idContratoProductora.

Data Modifications:

  • Modified data insertion statements in CANTIDAD_OFRECIDA and LOTE tables to align with the new constraints and ensure data consistency. [1] [2]

@Jrgil20 Jrgil20 merged commit 62889ed into dev Dec 13, 2024
@Jrgil20 Jrgil20 deleted the validations branch December 13, 2024 23:29
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