-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2af8caa
commit f7ecf9e
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
backend/src/main/resources/db/migration/prod/V9__alter_table_group_and_member.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE IF NOT EXISTS department | ||
( | ||
id bigint auto_increment primary key, | ||
part varchar(50) not null, | ||
term varchar(50) not null | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4; | ||
|
||
create table if not exists department_member | ||
( | ||
id bigint auto_increment primary key, | ||
member_id bigint not null, | ||
department_id bigint not null, | ||
constraint FK_DEPARTMENT_MEMBER_ON_MEMBERㅇ | ||
foreign key (member_id) references prolog.member (id), | ||
constraint FK_DEPARTMENT_MEMBER_ON_DEPARTMENT | ||
foreign key (department_id) references prolog.department (id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4; | ||
|
||
insert into department(id, part, term) values (1, '백엔드', '3기'); | ||
insert into department(id, part, term) values (2, '프론트엔드', '3기'); | ||
insert into department(id, part, term) values (3, '백엔드', '4기'); | ||
insert into department(id, part, term) values (4, '프론트엔드', '4기'); | ||
insert into department(id, part, term) values (5, '백엔드', '5기'); | ||
insert into department(id, part, term) values (6, '프론트엔드', '5기'); | ||
insert into department(id, part, term) values (7, '안드로이드', '5기'); | ||
|
||
insert into department_member (id, member_id, department_id) | ||
(select id, member_id, group_id from group_member); |