Dodano mapę kodu w .paul/codebase/ (7 dokumentów)

Wygenerowano przez równoległą analizę czterech agentów: stack, architektura,
konwencje, integracje, testy, baza danych oraz wykryte problemy i dług techniczny.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 19:57:07 +02:00
parent 009141455c
commit 0776c4531e
7 changed files with 558 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
# Database Schema — rank24.pl
Database: `host700513_rank24` (MySQL 5.x, charset utf8)
> This document reflects table names and columns inferred from source code analysis.
> For authoritative schema, run: `SHOW CREATE TABLE <table_name>;`
## Known Tables
### `pro_users`
Admin user accounts.
| Column | Type | Notes |
|--------|------|-------|
| `id` | int | PK |
| `login` | varchar | Username |
| `password` | varchar | MD5 hash (legacy) |
| `type` | varchar | Role: `admin` |
### `pro_rr_clients`
Client, reseller, and worker accounts.
| Column | Type | Notes |
|--------|------|-------|
| `id` | int | PK |
| `login` | varchar | |
| `password` | varchar | MD5 hash |
| `type` | int | 0=client, 1=reseller, 2=worker |
| `active` | int | |
| `reseller_id` | int | FK to self (reseller parent) |
### `pro_proxy_servers`
HTTP proxy pool for scraping.
| Column | Type | Notes |
|--------|------|-------|
| `id` | int | PK |
| `proxy` | varchar | `ip:port` |
| `bg` | int | Ban/backoff counter |
| `bgd` | datetime | Backoff until datetime |
| `used` | datetime | Last used timestamp |
| `enabled` | int | 1=active, 0=disabled |
### `pro_rr_sites`
Monitored websites per client.
| Column | Type | Notes |
|--------|------|-------|
| `id` | int | PK |
| `client_id` | int | FK → `pro_rr_clients.id` |
| `url` | varchar | Domain / URL |
| `active` | int | |
### `pro_rr_sites_majestic`
Majestic metrics cache per site.
| Column | Type | Notes |
|--------|------|-------|
| `site_id` | int | FK → `pro_rr_sites.id` |
| `trust_flow` | int | |
| `citation_flow` | int | |
| `external_backlinks` | int | |
| `ref_domains` | int | |
| `updated_at` | datetime | |
### `phrase_positions_statistic`
Live ranking data (rolling 2 years).
| Column | Type | Notes |
|--------|------|-------|
| `id` | int | PK |
| `phrase_id` | int | FK → phrases table |
| `date` | date | |
| `position` | int | Google rank position |
| `url` | varchar | Result URL |
### `phrase_positions_archive`
Archived ranking data (older than 2 years).
Same structure as `phrase_positions_statistic`.
## Table Name Patterns
All application tables use the `pro_` prefix:
- `pro_users` — admin users
- `pro_rr_clients` — clients / resellers / workers
- `pro_rr_sites` — tracked sites
- `pro_rr_sites_majestic` — Majestic metrics
- `pro_proxy_servers` — proxy pool
- `phrase_positions_statistic` — live positions (no prefix — legacy naming)
- `phrase_positions_archive` — archived positions
## Notes
- Passwords stored as **MD5** — upgrade to `password_hash()` / `password_verify()` is a known debt item
- Positions older than 2 years are moved from `phrase_positions_statistic``phrase_positions_archive` by `\Cron::archive_positions()`
- Missing positions (gaps in daily records) are interpolated by `\Cron::fill_missing_positions()`
- Proxy backoff: `bgd = NOW() + (bg * 15 MINUTE)` where `bg` increments on each failure