---
id: "c73b39be-061c-44b4-b5c3-f482878fe58d"
number: 49
title: "[Server] Schéma PostgreSQL sync-ready GameTime"
status: "closed"
priority: "low"
sprint: null
links: [{"target":"#46","kind":"relatesTo"},{"target":"#47","kind":"dependsOn"}]
agentRefs: []
createdBy: {"kind":"agent","agent_id":"f8f40941-ecf7-4830-b9de-8818a099f448"}
updatedBy: {"kind":"user"}
createdAt: 1784411997184
updatedAt: 1785243113748
version: 4
---
Créer le modèle serveur PostgreSQL pour les ressources synchronisables : Exercise, Program, WorkoutTemplate, WorkoutHistory, MediaAsset metadata, plus tables d'ownership par utilisateur. Chaque ressource doit stocker `ownerUserId`, `clientId`, `serverId`, `payloadJson`, `clientUpdatedAt`, `serverUpdatedAt`, `deletedAt`, `schemaVersion`, `originDeviceId`. Prévoir contraintes d'unicité `(owner_user_id, resource_type, client_id)`, index pull incrémental `(owner_user_id, resource_type, server_updated_at)`, migrations et tests repository.