| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | uuid | uuid_generate_v4() | false | |||
| employee_id | uuid | false | public.employees | |||
| token_hash | varchar(255) | false | ||||
| ip_address | varchar(45) | true | ||||
| user_agent | text | true | ||||
| expires_at | timestamp without time zone | false | ||||
| created_at | timestamp without time zone | now() | false |
| Name | Type | Definition |
|---|---|---|
| sessions_employee_id_fkey | FOREIGN KEY | FOREIGN KEY (employee_id) REFERENCES employees(id) ON DELETE CASCADE |
| sessions_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| sessions_token_hash_key | UNIQUE | UNIQUE (token_hash) |
| Name | Definition |
|---|---|
| sessions_pkey | CREATE UNIQUE INDEX sessions_pkey ON public.sessions USING btree (id) |
| sessions_token_hash_key | CREATE UNIQUE INDEX sessions_token_hash_key ON public.sessions USING btree (token_hash) |
| idx_sessions_employee_id | CREATE INDEX idx_sessions_employee_id ON public.sessions USING btree (employee_id) |
| idx_sessions_token_hash | CREATE INDEX idx_sessions_token_hash ON public.sessions USING btree (token_hash) |
| idx_sessions_expires_at | CREATE INDEX idx_sessions_expires_at ON public.sessions USING btree (expires_at) |
erDiagram
"public.sessions" }o--|| "public.employees" : "FOREIGN KEY (employee_id) REFERENCES employees(id) ON DELETE CASCADE"
"public.sessions" {
uuid id
uuid employee_id FK
varchar_255_ token_hash
varchar_45_ ip_address
text user_agent
timestamp_without_time_zone expires_at
timestamp_without_time_zone created_at
}
"public.employees" {
uuid id
uuid org_id FK
uuid team_id FK
uuid role_id FK
varchar_255_ email
varchar_255_ full_name
varchar_255_ password_hash
varchar_50_ status
jsonb preferences
timestamp_without_time_zone last_login_at
timestamp_without_time_zone created_at
timestamp_without_time_zone updated_at
timestamp_without_time_zone deleted_at
}
Generated by tbls