-- 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,
  `userinfo_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_code` varchar(20) 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 'default',
  `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` (`userinfo_uid`),
  KEY `FK_clientinfo_TO_accountinfo` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_accountinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  CONSTRAINT `FK_user_TO_accountinfo` FOREIGN KEY (`userinfo_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` (
  `code` varchar(20) NOT NULL COMMENT '고객코드',
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `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 'default',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`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,
  `userinfo_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
  `title` varchar(255) NOT NULL,
  `cnt` int(11) NOT NULL DEFAULT 0 COMMENT '갯수',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `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` (`userinfo_uid`),
  KEY `FK_clientinfo_TO_couponinfo` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_couponinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  CONSTRAINT `FK_user_TO_couponinfo` FOREIGN KEY (`userinfo_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,
  `serverinfo_code` varchar(20) 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 '기본금액',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '서비스금액',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `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_code`),
  CONSTRAINT `FK_serverinfo_TO_csinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
) 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,
  `lineinfo_uid` int(11) NOT NULL COMMENT '회선정보',
  `serverinfo_code` varchar(20) DEFAULT NULL COMMENT '서버코드',
  `ip` char(16) NOT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '서비스금액',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `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_serverinfo_TO_ipinfo` (`serverinfo_code`),
  CONSTRAINT `FK_lineinfo_TO_ipinfo` FOREIGN KEY (`lineinfo_uid`) REFERENCES `lineinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_ipinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
) 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,
  `type` varchar(20) NOT NULL COMMENT '회선구분',
  `title` varchar(100) NOT NULL,
  `bandwith` varchar(20) NOT NULL COMMENT 'IP 대역',
  `start_at` date DEFAULT NULL COMMENT '개통일',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `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,
  `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 'default',
  `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_month`
--

DROP TABLE IF EXISTS `payment_month`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_month` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보(결제처리자)',
  `clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
  `serviceinfo_coide` varchar(20) NOT NULL COMMENT '서비스코드',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '청구금액',
  `billing_at` date DEFAULT NULL COMMENT '지급기한일',
  `pay_method` varchar(20) DEFAULT NULL COMMENT '자뷸방법(ACCOUNT,COUPON)',
  `status` varchar(20) NOT NULL DEFAULT 'default' 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_month` (`user_uid`),
  KEY `FK_serviceinfo_TO_payment_month` (`serviceinfo_coide`),
  KEY `FK_clientinfo_TO_payment_month` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_payment_month` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  CONSTRAINT `FK_serviceinfo_TO_payment_month` FOREIGN KEY (`serviceinfo_coide`) REFERENCES `serviceinfo` (`code`),
  CONSTRAINT `FK_user_TO_payment_month` 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_month`
--

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

--
-- Table structure for table `payment_onetime`
--

DROP TABLE IF EXISTS `payment_onetime`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_onetime` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `user_uid` int(11) NOT NULL COMMENT '관리자정보(결제처리자)',
  `clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
  `serviceinfo_code` varchar(20) NOT NULL COMMENT '서비스코드',
  `title` varchar(50) DEFAULT NULL COMMENT '일회성 제목(제품명)',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '청구금액',
  `pay_method` varchar(20) DEFAULT NULL COMMENT '지불방법(ACCOUNT,COUPON)',
  `status` varchar(20) NOT NULL DEFAULT 'default' 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_onetime` (`user_uid`),
  KEY `FK_serviceinfo_TO_payment_onetime` (`serviceinfo_code`),
  KEY `FK_clientinfo_TO_payment_onetime` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_payment_onetime` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  CONSTRAINT `FK_serviceinfo_TO_payment_onetime` FOREIGN KEY (`serviceinfo_code`) REFERENCES `serviceinfo` (`code`),
  CONSTRAINT `FK_user_TO_payment_onetime` 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_onetime`
--

LOCK TABLES `payment_onetime` WRITE;
/*!40000 ALTER TABLE `payment_onetime` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_onetime` 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,
  `userinfo_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
  `title` varchar(255) NOT NULL,
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '포인트액',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `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` (`userinfo_uid`),
  KEY `FK_clientinfo_TO_pointinfo` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_pointinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  CONSTRAINT `FK_user_TO_pointinfo` FOREIGN KEY (`userinfo_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` (
  `code` varchar(20) NOT NULL COMMENT '서버코드',
  `serviceinfo_code` varchar(20) DEFAULT NULL COMMENT '서비스코드',
  `title` varchar(50) NOT NULL,
  `price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '서비스금액',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`code`),
  KEY `FK_serviceinfo_TO_serverinfo` (`serviceinfo_code`),
  CONSTRAINT `FK_serviceinfo_TO_serverinfo` FOREIGN KEY (`serviceinfo_code`) REFERENCES `serviceinfo` (`code`)
) 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,
  `serverinfo_code` varchar(20) NOT NULL COMMENT '서버코드',
  `partinfo_uid` int(11) NOT NULL COMMENT 'part정보',
  `cnt` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'cpu 갯수',
  `amount` int(11) NOT NULL DEFAULT 0 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_serverinfo_TO_serverinfo_partinfo` (`serverinfo_code`),
  KEY `FK_partinfo_TO_serverinfo_partinfo` (`partinfo_uid`),
  CONSTRAINT `FK_partinfo_TO_serverinfo_partinfo` FOREIGN KEY (`partinfo_uid`) REFERENCES `partinfo` (`uid`),
  CONSTRAINT `FK_serverinfo_TO_serverinfo_partinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
) 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` (
  `code` varchar(20) NOT NULL COMMENT '서비스코드',
  `user_uid` int(11) NOT NULL COMMENT '관리자정보',
  `clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
  `type` varchar(20) NOT NULL COMMENT '서비스형식((일발, 방어,전용,VPN,대체,,테스트,자사,코로케이션)',
  `location` varchar(20) DEFAULT NULL COMMENT '지역코드(chiba,tokyo,3center)',
  `billing_at` date NOT NULL COMMENT '청구일',
  `start_at` date NOT NULL COMMENT '시작일',
  `end_at` date DEFAULT NULL COMMENT '종료일',
  `amount` int(11) NOT NULL DEFAULT 0 COMMENT '서비스금액(IP+월별ITEM+CS의 서비스금액의 총합금액)',
  `history` text DEFAULT NULL COMMENT 'history',
  `status` varchar(20) NOT NULL DEFAULT 'default' COMMENT '상태',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`code`),
  KEY `FK_user_TO_serviceinfo` (`user_uid`),
  KEY `FK_clientinfo_TO_serviceinfo` (`clientinfo_code`),
  CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
  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` (
  `code` varchar(20) NOT NULL COMMENT 'switch코드',
  `serverinfo_code` varchar(20) DEFAULT NULL COMMENT '서버코드',
  `status` varchar(20) NOT NULL DEFAULT 'default',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`code`),
  KEY `FK_serverinfo_TO_switchinfo` (`serverinfo_code`),
  CONSTRAINT `FK_serverinfo_TO_switchinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
) 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 'default',
  `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','default','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','default','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','default','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','default','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','default','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','default','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','default','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','default','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','default','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','default','2025-08-08 01:08:02','2023-03-24 02:27:05',NULL),(12,'yunmuj','$2y$10$zkgwGVj2JSOVIsxLe8fePe1gvWWaCemfZMktzBlrN8oLb3CKydkZC','윤무정','yunmuj@idcjp.jp','','manager,cloudflare','default','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','default','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','default','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','default','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','default','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','default','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','default','2025-07-02 08:03:20','2025-07-01 06:05:11',NULL),(44,'test233332','$2y$10$9FqxChYQ3qlbGL0dFvHsQuEl3ELiH3R5kDytQqmFa2b2i9RYpjeQy','123423422','test2333@co.kr22','2343422','manager','default','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','default',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) DEFAULT 'default',
  `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-18 12:53:40
