Skip to content

Commit

Permalink
add(/resource): 테이블 생성 SQL 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hw0603 committed Mar 29, 2024
1 parent 9f390a3 commit ea4a08f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/resource/game.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use chess;

CREATE TABLE `game` (
`gameId` int NOT NULL AUTO_INCREMENT,
`turn` varchar(10) DEFAULT NULL,
PRIMARY KEY (`gameId`)
);
12 changes: 12 additions & 0 deletions src/main/java/resource/piece.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use chess;

CREATE TABLE `piece` (
`file` int NOT NULL,
`rank` int NOT NULL,
`pieceColor` varchar(50) NOT NULL,
`pieceType` varchar(50) NOT NULL,
`gameId` int NOT NULL,
PRIMARY KEY (`file`,`rank`,`gameId`),
KEY `gameId` (`gameId`),
CONSTRAINT `gameId` FOREIGN KEY (`gameId`) REFERENCES `game` (`gameId`)
);

0 comments on commit ea4a08f

Please sign in to comment.