Closed averbraeck closed 12 months ago
A bid
table linking groupround
with house
with a bid value has been added to the database. The code is as follows:
CREATE TABLE IF NOT EXISTS `housinggame`.`bid` (
`id` INT(10) UNSIGNED NOT NULL,
`price` INT NOT NULL,
`groupround_id` INT(10) UNSIGNED NOT NULL,
`house_id` INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE,
INDEX `fk_bid_groupround1_idx` (`groupround_id` ASC) VISIBLE,
INDEX `fk_bid_house1_idx` (`house_id` ASC) VISIBLE,
CONSTRAINT `fk_bid_groupround1`
FOREIGN KEY (`groupround_id`)
REFERENCES `housinggame`.`groupround` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_bid_house1`
FOREIGN KEY (`house_id`)
REFERENCES `housinggame`.`house` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
Code for bid adding and editing has been completed.
A player can bid on a house, changing its price. The facilitator has to be able to enter the bid value in the database. From that moment onward, the house has the value of the bid instead of the original value. The bid also has to be editable in the admin app.