-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 08, 2024 at 05:08 PM
-- Server version: 10.3.39-MariaDB-log
-- PHP Version: 8.1.27

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: `botpergas_panels`
--

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

--
-- Table structure for table `inboounds`
--

CREATE TABLE `inboounds` (
  `id` int(11) NOT NULL,
  `panel_id` int(11) NOT NULL DEFAULT 0,
  `user_id` int(11) NOT NULL DEFAULT 0,
  `inbound_id` int(11) NOT NULL DEFAULT 0,
  `name` varchar(50) NOT NULL DEFAULT '0',
  `port` int(11) NOT NULL DEFAULT 0,
  `format` varchar(500) NOT NULL DEFAULT '0',
  `max_id` int(11) NOT NULL DEFAULT 1000
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `interfaces`
--

CREATE TABLE `interfaces` (
  `Id` int(11) NOT NULL,
  `panel_id` int(11) DEFAULT 0,
  `user_id` int(11) DEFAULT 0,
  `interface` varchar(50) DEFAULT '0',
  `ip` varchar(100) DEFAULT '0',
  `port` int(11) DEFAULT 0,
  `dns` varchar(50) DEFAULT '8.8.8.8',
  `max_ip` int(11) DEFAULT 2,
  `check` int(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `middel_userpanel`
--

CREATE TABLE `middel_userpanel` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `panel_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `panels`
--

CREATE TABLE `panels` (
  `Id` int(11) NOT NULL,
  `type_server` int(11) DEFAULT 0,
  `Name` varchar(50) DEFAULT '0',
  `Ip` varchar(50) DEFAULT '000.000.000.000',
  `Port` int(11) DEFAULT 0,
  `ssl` int(1) DEFAULT 0,
  `Username` varchar(50) DEFAULT '0',
  `Password` varchar(50) DEFAULT '0',
  `domain` varchar(50) DEFAULT '0',
  `mangle` varchar(50) DEFAULT '0',
  `pre_key` int(11) DEFAULT 0,
  `link_ovpn` varchar(1000) DEFAULT NULL,
  `row_id` int(11) DEFAULT 500,
  `check` bit(1) DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `peers`
--

CREATE TABLE `peers` (
  `id` int(11) NOT NULL,
  `typeconfig` varchar(50) DEFAULT '0',
  `user_id` int(11) DEFAULT 0,
  `panel_id` int(11) DEFAULT 0,
  `interface_id` int(11) DEFAULT NULL,
  `name` varchar(50) DEFAULT '0',
  `pass` varchar(50) DEFAULT '0',
  `address` varchar(50) DEFAULT '0.0.0.0',
  `.id` varchar(50) DEFAULT '0',
  `limit_volome` bigint(20) DEFAULT 0,
  `expire_day` int(11) DEFAULT 0,
  `expire_date` varchar(10) DEFAULT '0',
  `format` varchar(1000) DEFAULT '0',
  `status` int(1) DEFAULT 0,
  `check` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `fullname` varchar(50) DEFAULT '0',
  `username` varchar(50) DEFAULT '0',
  `password` varchar(50) DEFAULT '0',
  `expire_date` varchar(100) DEFAULT '0',
  `protocol` varchar(50) DEFAULT '0',
  `volome` decimal(30,0) DEFAULT 0,
  `volome_use` decimal(30,0) DEFAULT 0,
  `status` bit(1) DEFAULT b'1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `interfaces`
--
ALTER TABLE `interfaces`
  ADD PRIMARY KEY (`Id`),
  ADD UNIQUE KEY `panel_id` (`panel_id`,`interface`);

--
-- Indexes for table `middel_userpanel`
--
ALTER TABLE `middel_userpanel`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_id` (`user_id`,`panel_id`);

--
-- Indexes for table `panels`
--
ALTER TABLE `panels`
  ADD PRIMARY KEY (`Id`);

--
-- Indexes for table `peers`
--
ALTER TABLE `peers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `interface_id` (`interface_id`,`name`,`address`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `inboounds`
--
ALTER TABLE `inboounds`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `interfaces`
--
ALTER TABLE `interfaces`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `middel_userpanel`
--
ALTER TABLE `middel_userpanel`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `panels`
--
ALTER TABLE `panels`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `peers`
--
ALTER TABLE `peers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
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 */;
