-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: serveur-prod-selfcarev3
-- Generation Time: Jan 25, 2023 at 08:37 AM
-- Server version: 8.0.24
-- PHP Version: 7.4.33

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 */;

--
-- Database: `napi`
--

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

--
-- Table structure for table `customer`
--

-- DROP TABLE `customer`, `ext_extension_user_centrex`, `ext_user_centrex`, `site`, `user`;

CREATE TABLE `customer` (
                            `id` int NOT NULL,
                            `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
                            `phone_bridge_enabled` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `ext_extension_user_centrex`
--

CREATE TABLE `ext_extension_user_centrex` (
                                              `id` int NOT NULL,
                                              `site_id` int DEFAULT NULL,
                                              `user_id` int DEFAULT NULL,
                                              `number` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
                                              `userExt_id` int DEFAULT NULL,
                                              `parent` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `ext_user_centrex`
--

CREATE TABLE `ext_user_centrex` (
                                    `id` int NOT NULL,
                                    `login` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
                                    `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
                                    `customCallerID` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `site`
--

CREATE TABLE `site` (
                        `id` int NOT NULL,
                        `customer_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
                        `id` int NOT NULL,
                        `site_id` int DEFAULT NULL,
                        `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
    ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ext_extension_user_centrex`
--
ALTER TABLE `ext_extension_user_centrex`
    ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_E7B192873252AD5F` (`userExt_id`);

--
-- Indexes for table `ext_user_centrex`
--
ALTER TABLE `ext_user_centrex`
    ADD PRIMARY KEY (`id`);

--
-- Indexes for table `site`
--
ALTER TABLE `site`
    ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_694309E49395C3F3` (`customer_id`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
    ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_8D93D649F6BD1646` (`site_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
    MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ext_extension_user_centrex`
--
ALTER TABLE `ext_extension_user_centrex`
    MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `site`
--
ALTER TABLE `site`
    MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
    MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `customer`
--


--
-- Constraints for table `ext_extension_user_centrex`
--
ALTER TABLE `ext_extension_user_centrex`
    ADD CONSTRAINT `FK_E7B192873252AD5F` FOREIGN KEY (`userExt_id`) REFERENCES `ext_user_centrex` (`id`),
  ADD CONSTRAINT `FK_E7B19287F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`);



--
-- Constraints for table `site`
--
ALTER TABLE `site`
    ADD CONSTRAINT `FK_694309E49395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`);


--
-- Constraints for table `user`
--
ALTER TABLE `user`
    ADD CONSTRAINT `FK_8D93D649F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`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 */;
