Initial import
This commit is contained in:
12
etc/db/work-db/sql/board-posts.sql
Executable file
12
etc/db/work-db/sql/board-posts.sql
Executable file
@@ -0,0 +1,12 @@
|
||||
create table if not exists board_posts (
|
||||
id serial primary key,
|
||||
title varchar(200) not null,
|
||||
content text not null,
|
||||
automation_plan_item_id integer null,
|
||||
automation_received_at timestamptz null,
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create index if not exists idx_board_posts_updated_at
|
||||
on board_posts (updated_at desc);
|
||||
16
etc/db/work-db/sql/notification-messages.sql
Executable file
16
etc/db/work-db/sql/notification-messages.sql
Executable file
@@ -0,0 +1,16 @@
|
||||
create table if not exists notification_messages (
|
||||
id serial primary key,
|
||||
title varchar(200) not null,
|
||||
body text not null,
|
||||
category varchar(60) not null default 'general',
|
||||
source varchar(80) not null default 'system',
|
||||
priority varchar(20) not null default 'normal',
|
||||
is_read boolean not null default false,
|
||||
read_at timestamptz null,
|
||||
metadata_json jsonb not null default '{}'::jsonb,
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create index if not exists idx_notification_messages_unread_created_at
|
||||
on notification_messages (is_read, created_at desc, id desc);
|
||||
34
etc/db/work-db/sql/visitor-history.sql
Executable file
34
etc/db/work-db/sql/visitor-history.sql
Executable file
@@ -0,0 +1,34 @@
|
||||
-- 방문자 마스터 테이블: clientId 단위 집계 정보 보관
|
||||
create table if not exists visitor_clients (
|
||||
id serial primary key,
|
||||
client_id varchar(120) not null unique,
|
||||
nickname varchar(80) not null,
|
||||
first_visited_at timestamptz not null default now(),
|
||||
last_visited_at timestamptz not null default now(),
|
||||
visit_count integer not null default 1,
|
||||
last_visited_url varchar(2000),
|
||||
last_user_agent varchar(1000),
|
||||
last_ip varchar(120),
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create index if not exists idx_visitor_clients_last_visited_at
|
||||
on visitor_clients (last_visited_at desc);
|
||||
|
||||
-- 방문 상세 이력 테이블: 중복 방문도 모두 적재
|
||||
create table if not exists visitor_visit_histories (
|
||||
id serial primary key,
|
||||
client_id varchar(120) not null,
|
||||
visited_at timestamptz not null default now(),
|
||||
url varchar(2000) not null,
|
||||
event_type varchar(80) not null default 'page_view',
|
||||
user_agent varchar(1000),
|
||||
ip varchar(120)
|
||||
);
|
||||
|
||||
create index if not exists idx_visitor_visit_histories_client_id
|
||||
on visitor_visit_histories (client_id);
|
||||
|
||||
create index if not exists idx_visitor_visit_histories_visited_at
|
||||
on visitor_visit_histories (visited_at desc);
|
||||
Reference in New Issue
Block a user