TeamFILL-IN / server-renew

spring base

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

account, reaction_history 엔티티 매핑 시 unique index 네이밍 변경

oownahcohc opened this issue · comments

AS IS

CREATE TABLE account (
  no  bigint auto_increment primary key,
  social  varchar(10) not null,
  social_id varchar(100) not null,
  refresh_token  varchar(500) ,
  user_no bigint,
);

CREATE UNIQUE INDEX index_unique_01 ON account(social, social_id);
CREATE TABLE reaction_history (
  no bigint auto_increment primary key,
  user_no bigint not null,
  target_type varchar(50) not null,
  target_no bigint not null,
  created_at datetime
);

CREATE UNIQUE INDEX index_unique_02 ON reaction_history(user_no, target_type, target_no);

TO BE

CREATE TABLE account (
  no  bigint auto_increment primary key,
  social  varchar(10) not null,
  social_id varchar(100) not null,
  refresh_token  varchar(500) ,
  user_no bigint,
);

CREATE UNIQUE INDEX ux_account_social_info ON account(social, social_id);
CREATE TABLE reaction_history (
  no bigint auto_increment primary key,
  user_no bigint not null,
  target_type varchar(50) not null,
  target_no bigint not null,
  created_at datetime
);

CREATE UNIQUE INDEX ux_reaction_user_and_target ON reaction_history(user_no, target_type, target_no);