Files
apex/server/db/migrations/001_formex_tables.sql
2026-02-13 00:21:53 +01:00

26 lines
786 B
SQL

-- Migration: Add Formex materials and sync logs tables
-- Run this on existing databases to add crawler support
-- Matériaux Formex (données scrapées)
CREATE TABLE IF NOT EXISTS formex_materials (
id INTEGER PRIMARY KEY AUTOINCREMENT,
formex_code TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
collection TEXT NOT NULL,
width_mm INTEGER,
height_mm INTEGER,
thickness_mm INTEGER,
formex_url TEXT,
last_synced_at TEXT DEFAULT (datetime('now'))
);
-- Journal de synchronisation
CREATE TABLE IF NOT EXISTS sync_logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source TEXT NOT NULL,
status TEXT NOT NULL,
items_count INTEGER,
error TEXT,
created_at TEXT DEFAULT (datetime('now'))
);