20221012_update.sql 426 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
create or replace table user_role
(
	user_role_id bigint auto_increment
		primary key,
	user_id bigint not null,
	role_id bigint not null,
	constraint user_role_user_id_role_id_uindex
		unique (user_id, role_id),
	constraint user_role_role_id_FK
		foreign key (role_id) references role (role_id)
			on delete cascade,
	constraint user_role_user_id_FK
		foreign key (user_id) references user (user_id)
			on delete cascade
);