-- Monark / SIREP v0 schema (base compatible con SIREP v2)
create table if not exists projects (
  id serial primary key,
  name text unique not null,
  kind text,
  domain text,
  potential int,
  projectness real,
  time_spent real,
  complexity real,
  dispersion real,
  convs int,
  start_date date,
  end_date date,
  meta jsonb default '{}'::jsonb
);

create table if not exists conversations (
  id text primary key,
  title text,
  created_at timestamptz,
  source text,
  chat_link text,
  project_name text,
  themes text[],
  msg_count int,
  user_chars int,
  assistant_chars int,
  urls int,
  files int,
  code_blocks int,
  meta jsonb default '{}'::jsonb
);

create index if not exists idx_conversations_project on conversations(project_name);
create index if not exists idx_conversations_created on conversations(created_at);
