-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 192.168.1.2
-- Généré le : dim. 12 avr. 2026 à 11:12
-- Version du serveur : 8.4.7
-- Version de PHP : 8.5.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Base de données : `carnet_de_vol`
--

-- --------------------------------------------------------

--
-- Structure de la table `appareils`
--

CREATE TABLE `appareils` (
  `id` int NOT NULL,
  `immatriculation` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `appareils`
--

INSERT INTO `appareils` (`id`, `immatriculation`) VALUES
(2, 'F-JLAB'),
(3, 'F-JUNG'),
(1, 'F-JVRZ');

-- --------------------------------------------------------

--
-- Structure de la table `terrains`
--

CREATE TABLE `terrains` (
  `id` int NOT NULL,
  `code` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `terrains`
--

INSERT INTO `terrains` (`id`, `code`) VALUES
(3, 'LFKB'),
(5, 'LFKO'),
(4, 'LFKT'),
(2, 'LFKY'),
(1, 'LFLP');

-- --------------------------------------------------------

--
-- Structure de la table `vols`
--

CREATE TABLE `vols` (
  `id` int NOT NULL,
  `date_vol` date NOT NULL,
  `appareil_id` int NOT NULL,
  `terrain_depart_id` int NOT NULL,
  `terrain_arrivee_id` int NOT NULL,
  `nombre_touche_pose` int DEFAULT '1',
  `temps_vol` time NOT NULL,
  `commentaire` text,
  `avec_instructeur` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `vols`
--

INSERT INTO `vols` (`id`, `date_vol`, `appareil_id`, `terrain_depart_id`, `terrain_arrivee_id`, `nombre_touche_pose`, `temps_vol`, `commentaire`, `avec_instructeur`) VALUES
(16, '2025-04-05', 1, 1, 1, 4, '00:43:00', '+lac', 0),
(17, '2025-04-03', 1, 1, 1, 6, '00:35:00', '', 0),
(19, '2025-01-17', 1, 1, 1, 1, '01:00:00', '', 1),
(20, '2025-01-18', 1, 1, 1, 3, '00:33:00', '', 0),
(21, '2025-01-25', 1, 1, 1, 5, '00:39:00', '', 1),
(22, '2025-02-08', 1, 1, 1, 3, '00:30:00', '', 0),
(23, '2025-03-06', 1, 1, 1, 5, '00:40:00', 'JLF', 1),
(24, '2025-03-08', 1, 1, 1, 5, '00:41:00', '', 0),
(25, '2025-03-20', 1, 1, 1, 5, '00:38:00', '', 0),
(26, '2025-03-21', 1, 1, 1, 3, '00:31:00', '', 0),
(27, '2025-04-19', 1, 1, 1, 6, '00:43:00', '', 0),
(28, '2025-05-01', 1, 1, 1, 1, '00:44:00', 'Lac', 0),
(29, '2025-05-14', 1, 1, 1, 2, '01:08:00', 'Touché belley', 1),
(30, '2025-05-15', 1, 1, 1, 5, '00:36:00', '', 0),
(31, '2025-05-24', 1, 1, 1, 1, '00:44:00', '', 1),
(32, '2025-05-29', 1, 1, 1, 1, '00:45:00', 'home + andilly', 0),
(33, '2025-06-21', 1, 1, 1, 4, '00:30:00', '', 0),
(34, '2025-06-26', 1, 1, 1, 4, '00:38:00', 'Vent travers 10kt', 0),
(35, '2025-06-28', 1, 1, 1, 1, '01:05:00', 'Bauges A/A', 0),
(36, '2025-06-29', 1, 1, 2, 1, '00:35:00', '', 0),
(37, '2025-06-29', 1, 2, 1, 1, '00:45:00', '', 0),
(38, '2025-07-23', 1, 1, 1, 3, '00:51:00', 'REV', 1),
(39, '2025-07-26', 1, 1, 1, 7, '00:44:00', '', 0),
(40, '2025-08-02', 1, 1, 1, 3, '00:42:00', '', 0),
(42, '2025-08-10', 1, 1, 1, 1, '01:10:00', 'Vallée verte + arve', 0),
(43, '2025-09-11', 1, 1, 1, 7, '00:50:00', '', 0),
(44, '2025-10-17', 1, 1, 1, 4, '00:35:00', '', 0),
(45, '2025-11-04', 1, 1, 1, 3, '01:08:00', 'Lac Albertville + 2TDP', 0),
(46, '2025-11-08', 1, 1, 2, 1, '00:45:00', '', 0),
(47, '2025-11-08', 1, 2, 1, 1, '00:35:00', '', 0),
(48, '2025-11-13', 1, 1, 1, 5, '00:41:00', '', 0),
(51, '2025-11-22', 2, 1, 1, 1, '00:38:00', 'Prise en main AB', 1),
(52, '2025-11-26', 2, 1, 1, 7, '00:50:00', 'TDP session 1', 1),
(53, '2025-11-28', 2, 1, 1, 7, '00:40:00', 'TDP PTU pannes', 1),
(54, '2025-11-29', 2, 1, 1, 2, '00:15:00', '', 1),
(55, '2025-11-29', 2, 1, 1, 2, '00:15:00', 'Laché AB', 0),
(56, '2025-12-01', 2, 1, 1, 4, '00:30:00', '', 0),
(59, '2025-12-18', 2, 1, 1, 1, '01:00:00', 'tamié - bauges', 0),
(60, '2025-12-12', 2, 1, 1, 5, '00:45:00', '', 0),
(61, '2026-01-17', 2, 1, 1, 5, '00:44:00', '', 0),
(62, '2026-01-24', 2, 1, 1, 4, '00:30:00', '', 0),
(64, '2026-02-04', 1, 1, 1, 4, '00:40:00', '', 0),
(68, '2026-02-13', 2, 1, 2, 1, '00:33:00', '', 0),
(69, '2026-02-13', 2, 2, 1, 1, '00:40:00', '', 0),
(71, '2026-02-28', 1, 1, 1, 5, '00:45:00', '', 0),
(72, '2026-03-05', 2, 1, 2, 2, '01:05:00', 'Touché bellegarde', 0),
(73, '2026-03-05', 2, 2, 1, 1, '00:25:00', '', 0),
(74, '2026-03-07', 2, 1, 1, 1, '00:50:00', 'Petit tour aravis', 0),
(75, '2026-03-17', 2, 1, 1, 1, '01:10:00', 'Mont blanc', 0),
(76, '2026-03-20', 2, 1, 2, 1, '00:27:00', '', 0),
(77, '2026-03-20', 2, 2, 1, 1, '00:31:00', '', 0),
(79, '2026-04-05', 3, 3, 3, 2, '01:14:00', '', 1),
(82, '2026-04-06', 3, 3, 4, 2, '00:30:00', 'Bastia Corte', 1),
(84, '2026-04-06', 3, 4, 3, 3, '01:00:00', 'LFKG (ghiso, touch) - FR1166', 1),
(86, '2026-04-06', 3, 4, 4, 7, '00:30:00', 'Corte TDP', 1),
(87, '2026-04-07', 3, 3, 5, 3, '02:10:00', 'LFKC (Calvi) LFKJ (Ajaccio) touch', 1),
(88, '2026-04-07', 3, 5, 3, 2, '01:45:00', 'LFKF Figari Touch', 1);

--
-- Index pour les tables déchargées
--

--
-- Index pour la table `appareils`
--
ALTER TABLE `appareils`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `immatriculation` (`immatriculation`);

--
-- Index pour la table `terrains`
--
ALTER TABLE `terrains`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

--
-- Index pour la table `vols`
--
ALTER TABLE `vols`
  ADD PRIMARY KEY (`id`),
  ADD KEY `appareil_id` (`appareil_id`),
  ADD KEY `terrain_depart_id` (`terrain_depart_id`),
  ADD KEY `terrain_arrivee_id` (`terrain_arrivee_id`);

--
-- AUTO_INCREMENT pour les tables déchargées
--

--
-- AUTO_INCREMENT pour la table `appareils`
--
ALTER TABLE `appareils`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT pour la table `terrains`
--
ALTER TABLE `terrains`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT pour la table `vols`
--
ALTER TABLE `vols`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `vols`
--
ALTER TABLE `vols`
  ADD CONSTRAINT `vols_ibfk_1` FOREIGN KEY (`appareil_id`) REFERENCES `appareils` (`id`),
  ADD CONSTRAINT `vols_ibfk_2` FOREIGN KEY (`terrain_depart_id`) REFERENCES `terrains` (`id`),
  ADD CONSTRAINT `vols_ibfk_3` FOREIGN KEY (`terrain_arrivee_id`) REFERENCES `terrains` (`id`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
