english-class-notify-db=# \d
List of relations
Schema | Name | Type | Owner
--------+------------------------+----------+-------
public | submit_messages | table | root
public | submit_messages_id_seq | sequence | root
public | teacher_schedules | table | root
public | teachers | table | root
(4 rows)
english-class-notify-db=# \d teachers
Table "public.teachers"
Column | Type | Collation | Nullable | Default
---------+-----------------------+-----------+----------+---------
id | character varying(6) | | not null |
name | character varying(30) | | not null |
country | character varying(40) | | not null |
Indexes:
"teachers_pkey" PRIMARY KEY, btree (id)
english-class-notify-db=# \d teacher_schedules
Table "public.teacher_schedules"
Column | Type | Collation | Nullable | Default
-----------------+-----------------------------+-----------+----------+---------
teacher_id | character varying(6) | | not null |
slot_datetime | timestamp without time zone | | not null |
opened_datetime | timestamp without time zone | | not null |
Indexes:
"teacher_schedules_pkey" PRIMARY KEY, btree (teacher_id, slot_datetime)
9 で議論した通りの構成です。