-- Structure de la base : appuistv_videos_4appuis
-- Date d'export : 2025-09-13 17:36:15

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

CREATE TABLE `codes` (
  `id` int 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 NOT NULL,
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

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

CREATE TABLE `paiements` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `invoice_id` varchar(100) NOT NULL,
  `user_phone` varchar(20) NOT NULL,
  `video_id` int unsigned DEFAULT NULL,
  `montant` int 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_0900_ai_ci;

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

CREATE TABLE `paytech_payments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ref_command` varchar(255) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_price` int 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 DEFAULT NULL,
  `numero` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=417 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

CREATE TABLE `signalements` (
  `id` int 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=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

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

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

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

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

