Skip to content

Commit

Permalink
Merge pull request #201 from innovationacademy-kr/develop
Browse files Browse the repository at this point in the history
main <- develop
  • Loading branch information
niamu01 authored Dec 19, 2023
2 parents 2451489 + 8ab8597 commit 03dd593
Show file tree
Hide file tree
Showing 94 changed files with 5,442 additions and 12,460 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ lerna-debug.log*
# OS
.DS_Store

# eslint
.eslintcache

# Tests
/coverage
/.nyc_output
Expand Down Expand Up @@ -42,5 +45,4 @@ db/
key/
sql/

test-db/
test-docker/
package-lock.json
8 changes: 6 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"singleQuote": true,
"trailingComma": "all"
}
"trailingComma": "all",
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"semi": true
}
42 changes: 42 additions & 0 deletions db/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
CREATE TABLE USER_INFO
(
USER_ID INT NOT NULL PRIMARY KEY,
LOGIN VARCHAR(50) NOT NULL,
IS_ADMIN BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT IDX_UNIQUE UNIQUE (USER_ID)
);

CREATE TABLE CARD_ISSUANCE
(
IDX BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
USER_ID INT NOT NULL,
CARD_ID VARCHAR(20) NOT NULL,
START_USE DATETIME NOT NULL,
END_USE DATETIME NOT NULL DEFAULT '9999-12-31 23:59:59',
CONSTRAINT FK_USER_ID FOREIGN KEY (USER_ID) REFERENCES USER_INFO (USER_ID),
CONSTRAINT IDX_UNIQUE UNIQUE (IDX)
);

CREATE TABLE DEVICE_INFO
(
DEVICE_ID INT NOT NULL PRIMARY KEY,
CAMPUS VARCHAR(15) NOT NULL,
IO_TYPE VARCHAR(3) NOT NULL,
CONSTRAINT DEVICE_ID_UNIQUE UNIQUE (DEVICE_ID)
);

CREATE TABLE TAG_LOG
(
IDX BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
TAG_AT DATETIME NOT NULL,
CARD_ID VARCHAR(15) NOT NULL,
DEVICE_ID INT NOT NULL,
CONSTRAINT IDX_UNIQUE UNIQUE (IDX)
);

CREATE TABLE PAIR_INFO
(
IN_DEVICE INT NOT NULL,
OUT_DEVICE INT NOT NULL,
CONSTRAINT PAIR_INFO_PK PRIMARY KEY (IN_DEVICE, OUT_DEVICE)
);
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'
services:
mysql:
image: mysql:latest
container_name: 24hane
hostname: 24hane
environment:
MYSQL_ROOT_PASSWORD: password42
MYSQL_DATABASE: checkin_v3
MYSQL_USER: checkin.local
MYSQL_PASSWORD: password42
volumes:
- ./db:/docker-entrypoint-initdb.d/
ports:
- "3311:3306"
restart: always
Loading

0 comments on commit 03dd593

Please sign in to comment.