-- Structure de la base : appuistv_videos_4appuis
-- Date d'export : 2025-11-26 00:26:41

-- ----------------------------
-- Structure de la table `codes`
-- ----------------------------

CREATE TABLE `codes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `video_id` varchar(100) NOT NULL,
  `numero` varchar(100) NOT NULL,
  `code` varchar(10) NOT NULL,
  `titre` varchar(100) NOT NULL,
  `miniature` varchar(100) NOT NULL,
  `verif` int(11) NOT NULL,
  `date_creation` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `comments`
-- ----------------------------

CREATE TABLE `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `video_id` varchar(50) NOT NULL,
  `numero` varchar(20) NOT NULL,
  `comment` text NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `parent_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `nb_vues`
-- ----------------------------

CREATE TABLE `nb_vues` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(250) NOT NULL,
  `id_video` int(11) NOT NULL,
  `titre` varchar(250) NOT NULL,
  `miniature` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=206 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `paiements`
-- ----------------------------

CREATE TABLE `paiements` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `invoice_id` varchar(100) NOT NULL,
  `user_phone` varchar(20) NOT NULL,
  `video_id` int(10) unsigned DEFAULT NULL,
  `montant` int(11) NOT NULL,
  `statut` enum('pending','completed','cancelled') NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `invoice_id` (`invoice_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `paytech_payments`
-- ----------------------------

CREATE TABLE `paytech_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ref_command` varchar(255) NOT NULL,
  `token_payment` varchar(255) DEFAULT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_price` int(11) NOT NULL,
  `currency` varchar(10) NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `video_id` int(11) DEFAULT NULL,
  `numero` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=758 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `signalements`
-- ----------------------------

CREATE TABLE `signalements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(20) NOT NULL,
  `raison` text NOT NULL,
  `date_signalement` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `tracker_logs`
-- ----------------------------

CREATE TABLE `tracker_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `image_id` varchar(100) DEFAULT NULL,
  `ip` varchar(45) NOT NULL,
  `user_agent` text DEFAULT NULL,
  `referer` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `region` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `users`
-- ----------------------------

CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero` varchar(250) NOT NULL,
  `datecree` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `users_correspondences`
-- ----------------------------

CREATE TABLE `users_correspondences` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero` int(11) NOT NULL DEFAULT 0,
  `id_video` int(11) NOT NULL DEFAULT 0,
  `miniature` varchar(250) NOT NULL,
  `titre` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Structure de la table `videos`
-- ----------------------------

CREATE TABLE `videos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titre` varchar(250) NOT NULL,
  `id_video` int(11) NOT NULL,
  `miniature` varchar(250) NOT NULL,
  `nb_vue` int(11) NOT NULL DEFAULT 0,
  `prix` int(11) NOT NULL,
  `avec` varchar(250) NOT NULL DEFAULT 'admin',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

