fixes #5749 Añadir clave primaria autoincrementable a la tabla vn.zoneIncluded #1590
Labels
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#1590
Loading…
Reference in New Issue
No description provided.
Delete Branch "5749-autoincrement-zoneIncluded"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: #5749 Añadir clave primaria autoincrementable a la tabla vn.zoneIncludedto fixes #5749 Añadir clave primaria autoincrementable a la tabla vn.zoneIncluded@ -37,11 +37,16 @@ module.exports = Self => {
if (isIncluded === undefined)
return models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
else {
return models.ZoneIncluded.upsert({
No hace falta quitar el upsert, en principio deberia continuar comportandose igual ya que hay una clave unique de zoneFk y geoFk
Estiguerem mirant-ho alexm i jo ahir i no varem poder canviar el model de loopback de ZoneIncluded per a posar que zoneFk i geoFk foren clave unica composta
@ -0,0 +7,4 @@
ADD PRIMARY KEY (`id`),
ADD CONSTRAINT `zoneIncluded_FK_1` FOREIGN KEY (zoneFk) REFERENCES `vn`.`zone`(id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `zoneIncluded_FK_2` FOREIGN KEY (geoFk) REFERENCES `vn`.`zoneGeo`(id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `unique_zone_geo` UNIQUE (`zoneFk`, `geoFk`);
Al fer DROP KEY
geoFk_idx
se perd el INDEX, faria falta possarli index?se crea un index para zoneFk y geoFk