Skip to content

Commit

Permalink
[#7] feature : 스키마 및 샘플 데이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
choitree committed May 6, 2021
1 parent d7bc4dd commit 6b6f038
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions BE/src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO game(id, home_team, away_team, home_score, away_score) values(1, 'captain', 'marvel', 0, 0);
INSERT INTO game(id, home_team, away_team, home_score, away_score) values(2, 'twins', 'tigers', 0, 0);
INSERT INTO game(id, home_team, away_team, home_score, away_score) values(3, 'twins', 'tigers', 0, 0);
-- INSERT INTO game(id, home_team, away_team, home_score, away_score, hit) values(3, 'twins', 'tigers', 0, 0, 1);
22 changes: 12 additions & 10 deletions BE/src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `baseball`.`player` (
`batting_average` DOUBLE NULL,
`number_of_pitches` VARCHAR(45) NULL,
`team_name` VARCHAR(45) NOT NULL,
`bat_order` INT NULL,
`batting_order` INT NULL,
PRIMARY KEY (`name`),
INDEX `fk_player_team_idx` (`team_name` ASC) VISIBLE,
CONSTRAINT `fk_player_team`
Expand All @@ -56,12 +56,12 @@ CREATE TABLE IF NOT EXISTS `baseball`.`player` (
DROP TABLE IF EXISTS `baseball`.`score` ;

CREATE TABLE IF NOT EXISTS `baseball`.`score` (
`created_at` DATETIME NOT NULL,
`id` INT NOT NULL,
`home` INT NOT NULL,
`away` INT NOT NULL,
`home_team` VARCHAR(45) NOT NULL,
`away_team` VARCHAR(45) NOT NULL,
PRIMARY KEY (`created_at`),
PRIMARY KEY (`id`),
INDEX `fk_score_team1_idx` (`home_team` ASC) VISIBLE,
INDEX `fk_score_team2_idx` (`away_team` ASC) VISIBLE,
CONSTRAINT `fk_score_team1`
Expand All @@ -78,21 +78,23 @@ CREATE TABLE IF NOT EXISTS `baseball`.`score` (


-- -----------------------------------------------------
-- Table `baseball`.`status_game`
-- Table `baseball`.`game`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `baseball`.`status_game` ;
DROP TABLE IF EXISTS `baseball`.`game` ;

CREATE TABLE IF NOT EXISTS `baseball`.`status_game` (
`home` VARCHAR(45) NOT NULL,
`away` VARCHAR(45) NOT NULL,
CREATE TABLE IF NOT EXISTS `baseball`.`game` (
`id` INT NOT NULL,
`home_team` VARCHAR(45) NOT NULL,
`away_team` VARCHAR(45) NOT NULL,
`home_score` INT NULL,
`away_score` INT NULL,
`inning` INT NULL,
`status` VARCHAR(45) NULL,
`ball_count` VARCHAR(45) NULL)
`ball` VARCHAR(45) NULL,
`hit` TINYINT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

0 comments on commit 6b6f038

Please sign in to comment.