-- Migration: 003_create_people
-- Description: 人员管理表
-- Date: 2026-08-01

CREATE TABLE IF NOT EXISTS people (
  id          INTEGER PRIMARY KEY AUTOINCREMENT,
  code        TEXT    NOT NULL UNIQUE,
  name        TEXT    NOT NULL,
  station     TEXT    NOT NULL,
  title       TEXT,
  phone       TEXT,
  joined_at   TEXT,
  status      TEXT    NOT NULL DEFAULT 'active',
  created_at  TEXT    NOT NULL DEFAULT (datetime('now', 'localtime')),
  updated_at  TEXT    NOT NULL DEFAULT (datetime('now', 'localtime'))
);

INSERT OR IGNORE INTO people
  (code, name, station, title, phone, joined_at, status)
VALUES
  ('PERSON_001', '林晓',     '北京记者站', '记者',           '13800001001', '2024-03-01', 'active'),
  ('PERSON_002', '周宁',     '北京记者站', '记者',           '13800001002', '2024-05-15', 'active'),
  ('PERSON_003', '陈屿',     '上海记者站', '记者',           '13900001001', '2023-09-01', 'active'),
  ('PERSON_004', '许言',     '浙江记者站', '记者',           '13900001002', '2024-01-10', 'active'),
  ('PERSON_005', '方澄',     '广东记者站', '记者',           '13900001003', '2023-11-20', 'active'),
  ('PERSON_006', '苏明远',   '北京记者站', '分站负责人',     '13800001003', '2023-01-01', 'active'),
  ('PERSON_007', '林致远',   '总部',       '总部管理员',     '13800001000', '2022-01-01', 'active'),
  ('PERSON_008', '赵雨薇',   '北京记者站', '记者',           '13800001004', '2025-02-01', 'inactive');