-- MySQL dump 10.19  Distrib 10.3.28-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: dbmsv2
-- ------------------------------------------------------
-- Server version	10.3.28-MariaDB-log

/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accountinfo`
--

DROP TABLE IF EXISTS `accountinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accountinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
  `bank` int(11) NOT NULL COMMENT '은행',
  `title` varchar(255) NOT NULL COMMENT '사유',
  `alias` varchar(50) NOT NULL COMMENT '입출금자명',
  `issue_at` date NOT NULL COMMENT '입출금일자',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '압출금액',
  `status` varchar(20) NOT NULL DEFAULT 'deposit',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_user_TO_accountinfo` (`user_uid`),
  KEY `FK_clientinfo_TO_accountinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_accountinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_user_TO_accountinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='예치금계좌';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accountinfo`
--

LOCK TABLES `accountinfo` WRITE;
/*!40000 ALTER TABLE `accountinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `accountinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `clientinfo`
--

DROP TABLE IF EXISTS `clientinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clientinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '고객정보',
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `code` varchar(20) NOT NULL COMMENT '고객코드',
  `site` varchar(20) NOT NULL DEFAULT 'prime' COMMENT 'Site구분',
  `role` varchar(50) NOT NULL DEFAULT 'user',
  `name` varchar(100) NOT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `email` varchar(50) NOT NULL,
  `history` text DEFAULT NULL COMMENT 'history',
  `account_balance` int(11) NOT NULL DEFAULT 0 COMMENT '예치금',
  `coupon_balance` int(11) NOT NULL DEFAULT 0 COMMENT '쿠폰수',
  `point_balance` int(11) NOT NULL DEFAULT 0 COMMENT '포인트',
  `status` varchar(20) NOT NULL DEFAULT 'normal',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_code` (`code`),
  UNIQUE KEY `UQ_name` (`name`),
  KEY `FK_user_TO_clientinfo` (`user_uid`),
  CONSTRAINT `FK_user_TO_clientinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='고객정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `clientinfo`
--

LOCK TABLES `clientinfo` WRITE;
/*!40000 ALTER TABLE `clientinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `clientinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `couponinfo`
--

DROP TABLE IF EXISTS `couponinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `couponinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
  `title` varchar(255) NOT NULL,
  `cnt` int(11) NOT NULL DEFAULT 0 COMMENT '갯수',
  `status` varchar(20) NOT NULL DEFAULT 'deposit',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_user_TO_couponinfo` (`user_uid`),
  KEY `FK_clientinfo_TO_couponinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_couponinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_user_TO_couponinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='쿠폰정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `couponinfo`
--

LOCK TABLES `couponinfo` WRITE;
/*!40000 ALTER TABLE `couponinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `couponinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `csinfo`
--

DROP TABLE IF EXISTS `csinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `csinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
  `serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
  `serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
  `type` varchar(20) NOT NULL COMMENT '구분(KCS,VCS)',
  `ip` varchar(50) NOT NULL,
  `accountid` varchar(50) DEFAULT NULL,
  `domain` varchar(100) DEFAULT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_ip` (`ip`),
  KEY `FK_serverinfo_TO_csinfo` (`serverinfo_uid`),
  KEY `FK_serviceinfo_TO_csinfo` (`serviceinfo_uid`),
  KEY `FK_clientinfo_TO_csinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_csinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_csinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_csinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CS정보(한서버 여러개 앞단 등록가능)';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `csinfo`
--

LOCK TABLES `csinfo` WRITE;
/*!40000 ALTER TABLE `csinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `csinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ipinfo`
--

DROP TABLE IF EXISTS `ipinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'IP정보',
  `lineinfo_uid` int(11) NOT NULL COMMENT '회선정보',
  `old_clientinfo_uid` int(11) DEFAULT NULL COMMENT '전고객정보',
  `clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
  `serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
  `serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
  `ip` char(16) NOT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `history` text DEFAULT NULL COMMENT 'history',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_ip` (`ip`),
  KEY `FK_lineinfo_TO_ipinfo` (`lineinfo_uid`),
  KEY `FK_clientinfo_TO_ipinfo` (`clientinfo_uid`),
  KEY `FK_serverinfo_TO_ipinfo` (`serverinfo_uid`),
  KEY `FK_serviceinfo_TO_ipinfo` (`serviceinfo_uid`),
  KEY `FK_clientinfo_TO_ipinfo1` (`old_clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_ipinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_clientinfo_TO_ipinfo1` FOREIGN KEY (`old_clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_lineinfo_TO_ipinfo` FOREIGN KEY (`lineinfo_uid`) REFERENCES `lineinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_ipinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_ipinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' IP정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ipinfo`
--

LOCK TABLES `ipinfo` WRITE;
/*!40000 ALTER TABLE `ipinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `ipinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `lineinfo`
--

DROP TABLE IF EXISTS `lineinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lineinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '회선정보',
  `type` varchar(20) NOT NULL COMMENT '회선구분',
  `title` varchar(100) NOT NULL,
  `bandwith` varchar(20) NOT NULL COMMENT 'IP 대역',
  `start_at` date DEFAULT NULL COMMENT '개통일',
  `end_at` date DEFAULT NULL COMMENT '해지일',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='회선정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `lineinfo`
--

LOCK TABLES `lineinfo` WRITE;
/*!40000 ALTER TABLE `lineinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `lineinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `partinfo`
--

DROP TABLE IF EXISTS `partinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `partinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'PART정보',
  `type` enum('CPU','RAM','DISK','SOFTWARE') NOT NULL COMMENT '형식',
  `title` varchar(50) NOT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='PART정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `partinfo`
--

LOCK TABLES `partinfo` WRITE;
/*!40000 ALTER TABLE `partinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `partinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payment`
--

DROP TABLE IF EXISTS `payment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
  `serviceinfo_uid` int(11) NOT NULL COMMENT '서비스정보',
  `title` varchar(50) NOT NULL COMMENT '청구 내용(제품명)',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '청구금액',
  `billing_method` varchar(20) NOT NULL COMMENT '청구방법(month,onetime)',
  `billing_at` date NOT NULL COMMENT '지급기한일(Onetime 발행당일)',
  `pay_method` varchar(20) DEFAULT NULL COMMENT '자뷸방법(ACCOUNT,COUPON)',
  `status` varchar(20) NOT NULL DEFAULT 'unpaid' COMMENT '상태(PAID,UNPAID)',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT '지불처리일',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '청구발행일',
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_user_TO_payment` (`user_uid`),
  KEY `FK_clientinfo_TO_payment` (`clientinfo_uid`),
  KEY `FK_serviceinfo_TO_payment` (`serviceinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_payment` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_payment` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`),
  CONSTRAINT `FK_user_TO_payment` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='결제정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payment`
--

LOCK TABLES `payment` WRITE;
/*!40000 ALTER TABLE `payment` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pointinfo`
--

DROP TABLE IF EXISTS `pointinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pointinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
  `title` varchar(255) NOT NULL,
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '포인트액',
  `status` varchar(20) NOT NULL DEFAULT 'deposit',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_user_TO_pointinfo` (`user_uid`),
  KEY `FK_clientinfo_TO_pointinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_pointinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_user_TO_pointinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='포인트정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pointinfo`
--

LOCK TABLES `pointinfo` WRITE;
/*!40000 ALTER TABLE `pointinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `pointinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `serverinfo`
--

DROP TABLE IF EXISTS `serverinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `serverinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '서버정보',
  `clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
  `serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
  `code` varchar(20) NOT NULL COMMENT '서버코드',
  `type` varchar(20) NOT NULL COMMENT '구분(밴더등)',
  `title` varchar(50) NOT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `total_price` int(11) NOT NULL DEFAULT 0 COMMENT '최종금액(PART+IP+CS)',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일',
  `format_at` timestamp NULL DEFAULT NULL COMMENT '포맷보류일',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_code` (`code`),
  KEY `FK_serviceinfo_TO_serverinfo` (`serviceinfo_uid`),
  KEY `FK_clientinfo_TO_serverinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_serverinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_serverinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서버정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `serverinfo`
--

LOCK TABLES `serverinfo` WRITE;
/*!40000 ALTER TABLE `serverinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `serverinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `serverinfo_partinfo`
--

DROP TABLE IF EXISTS `serverinfo_partinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `serverinfo_partinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `partinfo_uid` int(11) NOT NULL COMMENT 'PART정보',
  `serverinfo_uid` int(11) NOT NULL COMMENT '서버정보',
  `serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
  `billing_method` varchar(20) NOT NULL COMMENT '청구방법(month,onetime)',
  `cnt` tinyint(4) NOT NULL DEFAULT 1 COMMENT '갯수',
  `extra` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '추가정보(RAID등)',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`uid`),
  KEY `FK_partinfo_TO_serverinfo_partinfo` (`partinfo_uid`),
  KEY `FK_serverinfo_TO_serverinfo_partinfo` (`serverinfo_uid`),
  KEY `FK_serviceinfo_TO_serverinfo_partinfo` (`serviceinfo_uid`),
  CONSTRAINT `FK_partinfo_TO_serverinfo_partinfo` FOREIGN KEY (`partinfo_uid`) REFERENCES `partinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_serverinfo_partinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_serverinfo_partinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서버정보_part정보(CASECADE)';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `serverinfo_partinfo`
--

LOCK TABLES `serverinfo_partinfo` WRITE;
/*!40000 ALTER TABLE `serverinfo_partinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `serverinfo_partinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `serviceinfo`
--

DROP TABLE IF EXISTS `serviceinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `serviceinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '서비스정보',
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
  `code` varchar(20) NOT NULL COMMENT '서비스코드',
  `site` varchar(20) NOT NULL DEFAULT 'prime' COMMENT 'Site구분',
  `type` varchar(20) NOT NULL COMMENT '서비스형식((일반, 자사,코로케이션 등)',
  `location` varchar(20) DEFAULT NULL COMMENT '지역코드(chiba,tokyo,3center등)',
  `billing_at` date NOT NULL COMMENT '청구일',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '서비스금액(<=서버 최종금액)',
  `start_at` date NOT NULL COMMENT '시작일',
  `end_at` date DEFAULT NULL COMMENT '종료일',
  `history` text DEFAULT NULL COMMENT 'history',
  `status` varchar(20) NOT NULL DEFAULT 'normal' COMMENT '상태',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_code` (`code`),
  KEY `FK_user_TO_serviceinfo` (`user_uid`),
  KEY `FK_clientinfo_TO_serviceinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_user_TO_serviceinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서비스정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `serviceinfo`
--

LOCK TABLES `serviceinfo` WRITE;
/*!40000 ALTER TABLE `serviceinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `serviceinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `switchinfo`
--

DROP TABLE IF EXISTS `switchinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `switchinfo` (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '스위치정보',
  `clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
  `serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
  `serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
  `code` varchar(20) NOT NULL COMMENT 'switch코드',
  `status` varchar(20) NOT NULL DEFAULT 'available',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_code` (`code`),
  KEY `FK_serverinfo_TO_switchinfo` (`serverinfo_uid`),
  KEY `FK_serviceinfo_TO_switchinfo` (`serviceinfo_uid`),
  KEY `FK_clientinfo_TO_switchinfo` (`clientinfo_uid`),
  CONSTRAINT `FK_clientinfo_TO_switchinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_switchinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`),
  CONSTRAINT `FK_serviceinfo_TO_switchinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='스위치정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `switchinfo`
--

LOCK TABLES `switchinfo` WRITE;
/*!40000 ALTER TABLE `switchinfo` DISABLE KEYS */;
/*!40000 ALTER TABLE `switchinfo` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `id` varchar(20) NOT NULL,
  `passwd` varchar(255) NOT NULL,
  `name` varchar(20) NOT NULL,
  `email` varchar(50) NOT NULL,
  `mobile` varchar(20) DEFAULT NULL,
  `role` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'normal',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `UQ_id` (`id`),
  UNIQUE KEY `UQ_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COMMENT='관리자정보';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user`
--

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'choi.jh','$2y$10$.vl2FtwJsjMNFCJJm3ISDu7m3vBB85mZ5fRQxcfI0uK/2D1e8Xora','최준흠','choi.jh@prime-idc.jp','0434434327','manager,cloudflare,firewall,security,director,master','normal','2025-08-08 01:03:54','2023-03-23 06:50:04',NULL),(2,'cho.jh','$2y$10$ot/aUXR/W1n4Q3dZA2dZCOxQrpVb2Bq31Y7xFQS3G6D1gtImmyBjm','조준희','cho.jh@prime-idc.jp','','manager,cloudflare,security','normal','2025-08-08 01:03:41','2023-03-24 02:20:48',NULL),(4,'kimdy','$2y$10$18uyn94xdprzAnt.oYZ5weAvb8rRLhkz/SdQrjEK7yuGhCr9PlUCC','김동윤','kimdy@prime-idc.jp',NULL,'manager,cloudflare,security','normal','2025-06-24 01:10:17','2023-03-24 02:21:50',NULL),(5,'kimhy','$2y$10$.yEKVqY.F7HoSOZijl4uyeulUtfAQ4EDRiyR2JpgFYBuKw.mZoZvG','김효영','khy@prime-idc.jp',NULL,'manager,security,director','normal','2025-06-24 01:11:41','2023-03-24 02:23:18',NULL),(6,'kim.eh','$2y$10$YmwicI.Br4XNyGamfRADMOu.qlkwKd2fmnNkL7YIkNHGndvqYPnCq','김은혁','kim.eh@prime-idc.jp',NULL,'manager,cloudflare,security','normal','2025-06-24 01:09:38','2023-03-24 02:23:52',NULL),(7,'leeph','$2y$10$lR739WzJsW6rDLgchYs7buek4BYeTlKHTQY60RDqRms9Io7RSY3AC','이풍호','leeph@prime-idc.jp',NULL,'manager,cloudflare','normal','2023-05-29 16:32:52','2023-03-24 02:24:21',NULL),(8,'jinmingyu','$2y$10$PI8WA6d/z4hDE6hxJoUhbuMH3vTTWH0Ry2Z6fTLUUpwQGaE/9bEZa','김명옥','jinmingyu@idcjp.jp',NULL,'manager,cloudflare,security','normal','2025-06-24 01:09:47','2023-03-24 02:25:00',NULL),(9,'kangdh','$2y$10$gu9OS2DDQQ5H.Hh61t3BSOUp87l35q.xsduVSxvCcn8IgA4jrATgG','강동헌','kang.dh@idcjp.jp','','manager,cloudflare,security','normal','2025-08-08 01:06:54','2023-03-24 02:25:48',NULL),(10,'yoohs','$2y$10$TGASk98FuZ6Ux6FDquu1aO3rztA01MCle/Vs1.3iaEMQzakAbCzJy','유혜성','yoo.hs@idcjp.jp','','manager,cloudflare,security','normal','2025-08-08 01:08:08','2023-03-24 02:26:31',NULL),(11,'kim.yh','$2y$10$8GciQXpKYiR3TDWQfh9JjOQAQ.YWGoOSCL0a0/w4XACO0mUgjjbWy','김영환','kim.yh@idcjp.jp','','manager,cloudflare,firewall,security','normal','2025-08-08 01:08:02','2023-03-24 02:27:05',NULL),(12,'yunmuj','$2y$10$zkgwGVj2JSOVIsxLe8fePe1gvWWaCemfZMktzBlrN8oLb3CKydkZC','윤무정','yunmuj@idcjp.jp','','manager,cloudflare','normal','2025-08-08 01:07:57','2023-03-24 02:27:59',NULL),(13,'kim.mt','$2y$10$3dfkA0oq4LqiJOmjbBGKe.p0Dhj/MDqjoTdw11BOPF/H2qJqnEuHO','김문태','kim.mt@idcjp.jp','','manager,cloudflare,security','normal','2025-08-08 01:07:44','2023-03-24 02:28:31',NULL),(14,'shin.ms','$2y$10$.jaDkGtm/gZK3ZDF.fJUGOwMI7Zif5588X5AxSMvvk238RDI7spQ6','신민수','shin.ms@idcjp.jp',NULL,'manager,cloudflare','normal','2023-03-24 02:29:00','2023-03-24 02:29:00',NULL),(15,'park.sm','$2y$10$BwMxw0uvw2tAdQ0EZQ2/hu.Q7zYu7mbuBPPRTaa14bwG3VLf0cXfu','박선미','park.sm@idcjp.jp','','manager,cloudflare,security','normal','2025-08-08 01:07:33','2023-03-24 02:29:34',NULL),(24,'kobn','$2y$10$pWM/XFfSNeSng32sypbDX.WaR4UlM4EDkYKCQfFkYIOC7Ppg0nc5G','고병남','ko@prime-idc.jp',NULL,'manager,cloudflare,security','normal','2025-06-24 01:10:02','2024-10-29 06:30:19',NULL),(25,'jeong.sg','$2y$10$OzH6140JztiUEs4s/VHbPOxfxubFooqwqVhGpdFG8OJCGAFXNu546','정상구','jeong.sg@prime-idc.jp','','manager,cloudflare,security','normal','2025-08-08 01:07:26','2025-01-23 00:29:46',NULL),(43,'test1234','$2y$10$21wlqjmdfDlIr0vAjDzs6ubIchc1DwOG61GGkZUwY7gb9GMTxA96K','test1234','test@gmail.com','0434434327','manager,cloudflare','normal','2025-07-02 08:03:20','2025-07-01 06:05:11',NULL),(44,'test233332','$2y$10$9FqxChYQ3qlbGL0dFvHsQuEl3ELiH3R5kDytQqmFa2b2i9RYpjeQy','123423422','test2333@co.kr22','2343422','manager','normal','2025-07-11 07:24:04','2025-07-11 07:23:13',NULL),(45,'kim.jh','$2y$10$voCle9yFWWhGhQ0JrH46puLYySJYq6O41/BSrKxx0MHWyO8KDf97u','김준한','kim.jh@prime-idc.jp','','manager,cloudflare,security','normal',NULL,'2025-08-08 02:27:49',NULL);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user_history`
--

DROP TABLE IF EXISTS `user_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_history` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `title` varchar(255) NOT NULL,
  `content` text DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'normal',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  KEY `FK_user_TO_user_history` (`user_uid`),
  CONSTRAINT `FK_user_TO_user_history` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='작업 기록 로그';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user_history`
--

LOCK TABLES `user_history` WRITE;
/*!40000 ALTER TABLE `user_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_history` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-08-20 14:16:06
