Advertisement
Virajsinh

User Details Store Structure MySQL

Dec 2nd, 2024 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.96 KB | None | 0 0
  1. CREATE TABLE `user_device_info` (
  2.     `device_id` INT AUTO_INCREMENT PRIMARY KEY,  -- Unique identifier for the device
  3.     `user_id` INT NOT NULL,                      -- Foreign key to link this device to a specific user
  4.     `device_model` VARCHAR(255) COMMENT 'The model of the device (e.g., Pixel 6, iPhone 13)',  -- The model of the device
  5.     `internal_model_number` VARCHAR(50) COMMENT 'The internal model number assigned by the manufacturer (e.g., CPH2591)',
  6.     `manufacturer` VARCHAR(255) COMMENT 'Manufacturer of the device (e.g., Google, Apple)',  -- Manufacturer of the device
  7.     `brand` VARCHAR(255) COMMENT 'Brand of the device (e.g., Samsung, Google)',  -- Brand of the device
  8.     `os_version` VARCHAR(50) COMMENT 'The operating system version (e.g., Android 13, iOS 16)',  -- The OS version
  9.     `api_level` INT COMMENT 'The API level of the OS (e.g., API 30 for Android 11). For iOS, store the iOS version.',  -- The OS version level (Android API or iOS version)
  10.     `os_build_number` VARCHAR(255) COMMENT 'Build number of the operating system (e.g., build ID of Android)',  -- OS build number
  11.     `kernel_version` VARCHAR(255) COMMENT 'The kernel version of the device (e.g., Linux kernel 5.4)',  -- Kernel version of the OS
  12.     `time_zone` VARCHAR(100) COMMENT 'Time zone of the device (e.g., UTC, GMT+5)',  -- Time zone of the device
  13.     `language` VARCHAR(50) COMMENT 'Language set on the device (e.g., English, Spanish)',  -- Language set on the device
  14.    
  15.     `total_ram` BIGINT COMMENT 'Total RAM available on the device (in bytes)',  -- Total RAM of the device
  16.     `available_ram` BIGINT COMMENT 'Amount of available RAM at the current time (in bytes)',  -- Available RAM
  17.     `total_storage` BIGINT COMMENT 'Total storage capacity of the device (in bytes)',  -- Total storage capacity of the device
  18.     `available_storage` BIGINT COMMENT 'Amount of available storage at the current time (in bytes)',  -- Available storage space
  19.    
  20.     `ip_address` VARCHAR(45) COMMENT 'IP address of the device (supports both IPv4 and IPv6)',  -- Device IP address
  21.     `wifi_network_name` VARCHAR(255) COMMENT 'The name of the Wi-Fi network to which the device is connected (SSID)',  -- SSID of connected Wi-Fi
  22.     `mobile_network` VARCHAR(50) COMMENT 'Type of mobile network (e.g., 4G, 5G, LTE)',  -- Type of mobile network
  23.     `bluetooth_status` BOOLEAN COMMENT 'Whether Bluetooth is enabled or not (TRUE/FALSE)',  -- Bluetooth status
  24.    
  25.     `battery_level` INT COMMENT 'The current battery level of the device (percentage)',  -- Battery level percentage
  26.     `battery_status` VARCHAR(50) COMMENT 'The status of the battery (e.g., charging, discharging, full)',  -- Battery charging status
  27.     `battery_health` VARCHAR(50) COMMENT 'The health of the battery (e.g., good, poor)',  -- Battery health status
  28.    
  29.     `device_modifications` VARCHAR(50) COMMENT 'Whether the device is rooted (Android) or jailbroken (iPhone)',  -- Whether the device is rooted (Android) or jailbroken (iPhone)
  30.     `device_encryption` BOOLEAN COMMENT 'Whether the device\'s storage is encrypted (TRUE/FALSE)',  -- Encryption status of the device
  31.     `security_patch_level` DATE COMMENT 'Date of the latest security patch (e.g., 2023-11-01). For iPhone, store the date of the last iOS update.',  -- Last security patch date for Android or last iOS update for iPhone
  32.    
  33.     `screen_resolution` VARCHAR(50) COMMENT 'The resolution of the device\'s display (e.g., 1080x2400)',  -- Screen resolution (width x height)
  34.     `screen_density` INT COMMENT 'Screen density (DPI) of the display (e.g., 320 DPI)',  -- Screen density in DPI
  35.     `screen_size` VARCHAR(50) COMMENT 'Physical screen size (in inches) (e.g., 6.5 inches)',  -- Screen size in inches
  36.     `orientation` VARCHAR(20) COMMENT 'Orientation of the screen (e.g., portrait, landscape)',  -- Screen orientation
  37.    
  38.     `sensors_available` TEXT COMMENT 'List of sensors available on the device (e.g., accelerometer, gyroscope). These may differ between Android and iOS.',  -- Sensors available on the device
  39.     `camera_info` TEXT COMMENT 'Camera specifications (e.g., 12MP rear, 8MP front). These can vary across devices.',  -- Camera information (Android and iOS)
  40.     `gps_status` BOOLEAN COMMENT 'Whether GPS is enabled on the device (TRUE/FALSE)',  -- GPS status
  41.    
  42.     `app_version` VARCHAR(50) COMMENT 'The version of your app installed on the device (e.g., v1.2.3)',  -- Version of the app installed
  43.     `last_app_update_date` DATE COMMENT 'The date the app was last updated on the device (e.g., 2023-12-01)',  -- Last app update date
  44.    
  45.     `device_logs` TEXT COMMENT 'Optional: Logs for troubleshooting purposes (use with caution)',  -- Device logs (if needed for debugging)
  46.     `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp when the record was created',  -- Record creation timestamp
  47.     `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Timestamp when the record was last updated'  -- Record update timestamp
  48. );
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement