- Mise à jour VERSION vers 3.3.4 - Optimisations et révisions architecture API (deploy-api.sh, scripts de migration) - Ajout documentation Stripe Tap to Pay complète - Migration vers polices Inter Variable pour Flutter - Optimisations build Android et nettoyage fichiers temporaires - Amélioration système de déploiement avec gestion backups - Ajout scripts CRON et migrations base de données 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
2.8 KiB
SQL
54 lines
2.8 KiB
SQL
-- Table pour stocker les informations des devices des utilisateurs
|
|
CREATE TABLE IF NOT EXISTS `user_devices` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`fk_user` int(10) unsigned NOT NULL COMMENT 'Référence vers la table users',
|
|
|
|
-- Informations générales du device
|
|
`platform` varchar(20) NOT NULL COMMENT 'Plateforme: iOS, Android, etc.',
|
|
`device_model` varchar(100) DEFAULT NULL COMMENT 'Modèle du device (ex: iPhone13,2)',
|
|
`device_name` varchar(255) DEFAULT NULL COMMENT 'Nom personnalisé du device',
|
|
`device_manufacturer` varchar(100) DEFAULT NULL COMMENT 'Fabricant (Apple, Samsung, etc.)',
|
|
`device_identifier` varchar(100) DEFAULT NULL COMMENT 'Identifiant unique du device',
|
|
|
|
-- Informations réseau (IPv4 uniquement)
|
|
`device_ip_local` varchar(15) DEFAULT NULL COMMENT 'Adresse IP locale IPv4',
|
|
`device_ip_public` varchar(15) DEFAULT NULL COMMENT 'Adresse IP publique IPv4',
|
|
`device_wifi_name` varchar(255) DEFAULT NULL COMMENT 'Nom du réseau WiFi (SSID)',
|
|
`device_wifi_bssid` varchar(17) DEFAULT NULL COMMENT 'BSSID du point d\'accès (format
|
|
XX:XX:XX:XX:XX:XX)',
|
|
|
|
-- Capacités et version OS
|
|
`ios_version` varchar(20) DEFAULT NULL COMMENT 'Version iOS/Android OS',
|
|
`device_nfc_capable` tinyint(1) DEFAULT NULL COMMENT 'Support NFC (1=oui, 0=non)',
|
|
`device_supports_tap_to_pay` tinyint(1) DEFAULT NULL COMMENT 'Support Tap to Pay (1=oui, 0=non)',
|
|
|
|
-- État batterie
|
|
`battery_level` tinyint(3) unsigned DEFAULT NULL COMMENT 'Niveau batterie en pourcentage (0-100)',
|
|
`battery_charging` tinyint(1) DEFAULT NULL COMMENT 'En charge (1=oui, 0=non)',
|
|
`battery_state` varchar(20) DEFAULT NULL COMMENT 'État batterie (charging, discharging, full)',
|
|
|
|
-- Versions application
|
|
`app_version` varchar(20) DEFAULT NULL COMMENT 'Version de l\'application (ex: 3.2.8)',
|
|
`app_build` varchar(20) DEFAULT NULL COMMENT 'Numéro de build (ex: 328)',
|
|
|
|
-- Timestamps
|
|
`last_device_info_check` timestamp NULL DEFAULT NULL COMMENT 'Dernier check des infos device côté
|
|
app',
|
|
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date de création de
|
|
l\'enregistrement',
|
|
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT
|
|
'Date de dernière modification',
|
|
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_fk_user` (`fk_user`) COMMENT 'Index pour recherche par utilisateur',
|
|
KEY `idx_updated_at` (`updated_at`) COMMENT 'Index pour tri par date de mise à jour',
|
|
KEY `idx_last_check` (`last_device_info_check`) COMMENT 'Index pour recherche par dernière
|
|
vérification',
|
|
UNIQUE KEY `unique_user_device` (`fk_user`, `device_identifier`) COMMENT 'Un seul enregistrement
|
|
par device/user',
|
|
|
|
CONSTRAINT `fk_user_devices_user` FOREIGN KEY (`fk_user`)
|
|
REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Informations des devices
|
|
utilisateurs';
|