AntonSangho / moya_attendance

이 프로젝트는 어린이작업장 '모야'에 설치될 입출력관리시스템입니다.
1 stars 0 forks source link

디비모델링 #4

Closed happydeveloper closed 4 years ago

happydeveloper commented 4 years ago

사용자 테이블 출입로그 테이블

AntonSangho commented 4 years ago

create table attendance( id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE, user_id INT UNSIGNED NOT NULL, clock_in TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ( id ) );

  • id – This is an integer that is used to keep track of the current row and increases automatically.

  • user_id – This is an integer, and we utilize this to tie attendance with a user in our users table that has the same id.

  • clock_in – This variable stores a SQL timestamp. This timestamp is used to track when the user taps their RFID card onto the RFID reader.

create table users( id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE, rfid_uid VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ( id ) );

  • id – This is an integer that is used to keep track of the current user and increases automatically.

  • rfid_uid – This variable is used to store the UID that is captured when an RFID card is tapped on the RFID reader.

  • name – This variable stores the name of the person who owns the RFID card.

  • created – We use this variable to keep track of when the user was created.

AntonSangho commented 4 years ago

create table attendance( id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE, user_id INT UNSIGNED NOT NULL, clock_in TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ( id ) );

  • id – This is an integer that is used to keep track of the current row and increases automatically.
  • user_id – This is an integer, and we utilize this to tie attendance with a user in our users table that has the same id.
  • clock_in – This variable stores a SQL timestamp. This timestamp is used to track when the user taps their RFID card onto the RFID reader.

create table users( id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE, rfid_uid VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ( id ) );

  • id – This is an integer that is used to keep track of the current user and increases automatically.
  • rfid_uid – This variable is used to store the UID that is captured when an RFID card is tapped on the RFID reader.
  • name – This variable stores the name of the person who owns the RFID card.
  • created – We use this variable to keep track of when the user was created.

@happydeveloper 여기 참고해주세요

happydeveloper commented 4 years ago

모델링 반영~ 인증테이블과 비지니스 로직 테이블이 필요해 보여요! @AntonSangho

happydeveloper commented 4 years ago

사용자 상세 페이지 출력