Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
oownahcohc opened this issue Nov 20, 2023 · 0 comments
Assignees

Comments

@oownahcohc
Copy link

oownahcohc commented Nov 20, 2023

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant