averbraeck / housinggame-admin

Administrator app for the Housing Game
https://housing-game.tbm.tudelft.nl
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Add a bid table in the database #13

Closed averbraeck closed 12 months ago

averbraeck commented 1 year ago

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.

averbraeck commented 1 year 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
averbraeck commented 12 months ago

Code for bid adding and editing has been completed.