-- 작업날짜 :  2024년 04월 01일 월요일 오후 20시 41분 / 맑음, 6.6, 일교차 주의, 18, 3, 0%, 0%, 0.5ms / 양호, 35, 15

-- 피리 > 피리 카페 심플 > 테이블 SCHEMA

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

-- 카페 목록

--
-- Table structure for table `g5__piree__cafe`
--

DROP TABLE IF EXISTS `g5__piree__cafe`;
CREATE TABLE IF NOT EXISTS `g5__piree__cafe` (
  `cafe_row_n` INT(11) NOT NULL auto_increment,

  `cafe_mem_n` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  `cafe_mem_id` VARCHAR(20) NOT NULL DEFAULT '',
  `cafe_mem_nick` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_mem_level_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1',

  `cafe_code_c` VARCHAR(16) BINARY NOT NULL DEFAULT '',

  `cafe_name_s` VARCHAR(255) NOT NULL DEFAULT '',

  `cafe_image_face_s` VARCHAR(60) NOT NULL DEFAULT '',

  `cafe_cate_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `cafe_cate_n_p` VARCHAR(255) DEFAULT '0',
  `cafe_cate_name_s` VARCHAR(40) NOT NULL DEFAULT '',
  `cafe_cate_s_p` VARCHAR(255) DEFAULT '0',

  `cafe_region_n` SMALLINT(6) NOT NULL DEFAULT '0',
  -- `cafe_region_1_n` SMALLINT(6) NOT NULL DEFAULT '0',
  -- `cafe_region_2_n` SMALLINT(6) NOT NULL DEFAULT '0',

  `cafe_region_prog_n` INT(11) NOT NULL,

  `cafe_region_n_p` VARCHAR(255) DEFAULT '0',

  `cafe_region_l_s` VARCHAR(40) NOT NULL DEFAULT '',
  -- `cafe_region_1_s` VARCHAR(40) NOT NULL DEFAULT '',
  -- `cafe_region_2_s` VARCHAR(40) NOT NULL DEFAULT '',
  `cafe_region_s_p` VARCHAR(255) DEFAULT '0',

  `cafe_skin_basic_pc_c` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_skin_basic_mo_c` VARCHAR(255) NOT NULL DEFAULT '',

  `cafe_skin_manage_pc_c` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_skin_manage_mo_c` VARCHAR(255) NOT NULL DEFAULT '',

  `cafe_join_level_n` TINYINT(3) NOT NULL DEFAULT '0',

  `cafe_member_view_level_n` TINYINT(3) NOT NULL DEFAULT '0',
  `cafe_member_view_info_open_n` TINYINT(3) NOT NULL DEFAULT '0',

  `cafe_board_config_n` INT(11) NOT NULL DEFAULT '0',

  `cafe_keyword_t` TINYINT(3) NOT NULL DEFAULT '0',
  `cafe_member_t` INT(11) NOT NULL DEFAULT '0',
  `cafe_member_v` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_board_t` INT(11) NOT NULL DEFAULT '0',
  `cafe_article_t` INT(11) NOT NULL DEFAULT '0',
  `cafe_comment_t` INT(11) NOT NULL DEFAULT '0',
  `cafe_image_t` INT(11) NOT NULL DEFAULT '0',

  `cafe_intro_s` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_join_guide_s` VARCHAR(255) NOT NULL DEFAULT '',
  `cafe_contract_s` text NOT NULL,

  `cafe_ip_s` VARCHAR(40) NOT NULL DEFAULT '',

  `cafe_regi_time_n` INT(11) NOT NULL,
  `cafe_modi_time_n` INT(11) NOT NULL,
  `cafe_relo_time_n` INT(11) NOT NULL,

  PRIMARY KEY  (`cafe_row_n`),
  UNIQUE KEY `u_code` (`cafe_code_c`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

-- 카페 회원 목록

--
-- Table structure for table `g5__piree__cafe_member`
--

DROP TABLE IF EXISTS `g5__piree__cafe_member`;
CREATE TABLE IF NOT EXISTS `g5__piree__cafe_member` (

  `cfml_row_n` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,

  `cfml_cafe_n` INT(11) UNSIGNED NOT NULL DEFAULT '0',

  `cfml_cafe_mem_level_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',

  `cfml_mem_n` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  `cfml_mem_id` VARCHAR(20) NOT NULL DEFAULT '',
  `cfml_mem_nick` VARCHAR(255) NOT NULL DEFAULT '',

  `cfml_cafe_s` VARCHAR(30) NOT NULL DEFAULT '',

  `cfml_article_t` INT(11) NOT NULL DEFAULT '0',
  `cfml_comment_t` INT(11) NOT NULL DEFAULT '0',
  `cfml_image_t` INT(11) NOT NULL DEFAULT '0',

  `cfml_ip_s` VARCHAR(40) NOT NULL DEFAULT '',

  `cfml_join_time_n` INT(11) NOT NULL,
  `cfml_modi_time_n` INT(11) NOT NULL,

  PRIMARY KEY  (`cfml_row_n`),
  KEY `k_mem_n` (`cfml_mem_n`),
  KEY `k_mem_id` (`cfml_mem_id`),
  KEY `k_cafe_n` (`cfml_cafe_n`),
  UNIQUE KEY `u_jn_mn` (`cfml_cafe_n`, `cfml_mem_n`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

-- 카페 검색어

--
-- Table structure for table `g5__piree__cafe_keyword`
--

DROP TABLE IF EXISTS `g5__piree__cafe_keyword`;
CREATE TABLE IF NOT EXISTS `g5__piree__cafe_keyword` (

  `cfkw_row_n` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,

  `cfkw_cafe_n` INT(11) NOT NULL DEFAULT '0',
  `cfkw_cafe_c` VARCHAR(16) BINARY NOT NULL DEFAULT '',

  `cfkw_mem_n` INT(11) NOT NULL DEFAULT '0',

  `cfkw_keyword_3_s` CHAR(3) NOT NULL DEFAULT '',
  `cfkw_keyword_s` VARCHAR(60) NOT NULL DEFAULT '',

  `cfkw_seq_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',

  `cfkw_ip_s` VARCHAR(40) NOT NULL DEFAULT '',

  `cfkw_regi_time_n` INT(11) NOT NULL,

  PRIMARY KEY  (`cfkw_row_n`),
  KEY `k_pn` (`cfkw_cafe_n`),
  UNIQUE KEY `u_cfn_wds` (`cfkw_cafe_n`, `cfkw_keyword_s`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `g5__piree__board_category`
--

DROP TABLE IF EXISTS `g5__piree__board_category`;

CREATE TABLE IF NOT EXISTS `g5__piree__board_category` (
  `bca_row_n` INT(11) NOT NULL AUTO_INCREMENT,

  `bca_cafe_n` INT(11) NOT NULL DEFAULT '0',
  `bca_cafe_c` VARCHAR(16) BINARY NOT NULL DEFAULT '',
  `bca_cafe_s` VARCHAR(30) NOT NULL DEFAULT '',

  `bca_cate_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `bca_1_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `bca_2_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `bca_cate_n_p` VARCHAR(255) DEFAULT '0',

  `bca_cate_s` VARCHAR(255) NOT NULL DEFAULT '',
  `bca_1_s` VARCHAR(255) NOT NULL DEFAULT '',
  `bca_2_s` VARCHAR(255) NOT NULL DEFAULT '',
  `bca_s_p` VARCHAR(255) DEFAULT '0',

  `bca_depth_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
  `bca_parent_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `bca_sub_t` INT(11) NOT NULL DEFAULT '0',
  `bca_row_t` INT(11) NOT NULL DEFAULT '0',
  `bca_article_t` INT(11) NOT NULL DEFAULT '0',


  `bca_device` enum('both','pc','mobile') NOT NULL DEFAULT 'both',
  `bca_list_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_read_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_write_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_reply_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_comment_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_upload_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_download_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_html_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_link_level` tinyint(4) NOT NULL DEFAULT '0',
  `bca_count_delete` tinyint(4) NOT NULL DEFAULT '0',
  `bca_count_modify` tinyint(4) NOT NULL DEFAULT '0',
  `bca_read_point` int(11) NOT NULL DEFAULT '0',
  `bca_write_point` int(11) NOT NULL DEFAULT '0',
  `bca_comment_point` int(11) NOT NULL DEFAULT '0',
  `bca_download_point` int(11) NOT NULL DEFAULT '0',
  `bca_use_sideview` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_file_content` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_secret` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_dhtml_editor` tinyint(4) NOT NULL DEFAULT '0',
  `bca_select_editor` varchar(50) NOT NULL DEFAULT '',
  `bca_use_rss_view` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_good` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_nogood` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_name` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_signature` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_ip_view` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_list_view` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_list_file` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_list_content` tinyint(4) NOT NULL DEFAULT '0',
  `bca_table_width` int(11) NOT NULL DEFAULT '0',
  `bca_pc_subject_len` int(11) NOT NULL DEFAULT '0',
  `bca_mo_subject_len` int(11) NOT NULL DEFAULT '0',
  `bca_pc_page_rows` int(11) NOT NULL DEFAULT '0',
  `bca_mo_page_rows` int(11) NOT NULL DEFAULT '0',
  `bca_new` int(11) NOT NULL DEFAULT '0',
  `bca_hot` int(11) NOT NULL DEFAULT '0',
  `bca_image_width` int(11) NOT NULL DEFAULT '0',
  `bca_pc_skin` varchar(255) NOT NULL DEFAULT '',
  `bca_mo_skin` varchar(255) NOT NULL DEFAULT '',
  `bca_include_head` varchar(255) NOT NULL DEFAULT '',
  `bca_include_tail` varchar(255) NOT NULL DEFAULT '',
  `bca_pc_content_head` text NOT NULL,
  `bca_pc_content_tail` text NOT NULL,
  `bca_mo_content_head` text NOT NULL,
  `bca_mo_content_tail` text NOT NULL,
  `bca_insert_content` text NOT NULL,
  `bca_gallery_cols` int(11) NOT NULL DEFAULT '0',
  `bca_pc_gallery_width` int(11) NOT NULL DEFAULT '0',
  `bca_pc_gallery_height` int(11) NOT NULL DEFAULT '0',
  `bca_mo_gallery_width` int(11) NOT NULL DEFAULT '0',
  `bca_mo_gallery_height` int(11) NOT NULL DEFAULT '0',
  `bca_upload_size` int(11) NOT NULL DEFAULT '0',
  `bca_reply_order` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_search` tinyint(4) NOT NULL DEFAULT '0',
  `bca_order` int(11) NOT NULL DEFAULT '0',
  `bca_count_write` int(11) NOT NULL DEFAULT '0',
  `bca_count_comment` int(11) NOT NULL DEFAULT '0',
  `bca_write_min` int(11) NOT NULL DEFAULT '0',
  `bca_write_max` int(11) NOT NULL DEFAULT '0',
  `bca_comment_min` int(11) NOT NULL DEFAULT '0',
  `bca_comment_max` int(11) NOT NULL DEFAULT '0',
  `bca_notice` text NOT NULL,
  `bca_upload_count` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_email` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_cert` enum('','cert','adult','hp-cert','hp-adult') NOT NULL DEFAULT '',
  `bca_use_sns` tinyint(4) NOT NULL DEFAULT '0',
  `bca_use_captcha` tinyint(4) NOT NULL DEFAULT '0',
  `bca_sort_field` varchar(255) NOT NULL DEFAULT '',


  `bca_regi_time_n` INT(11) NOT NULL DEFAULT '0',
  `bca_modi_time_n` INT(11) NOT NULL DEFAULT '0',
  `bca_relo_time_n` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY  (`bca_row_n`),
  KEY `k_reg_n` (`bca_cafe_n`),
  UNIQUE KEY `u_cfn_can` (`bca_cafe_n`, `bca_cate_n`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `g5__piree__category`
--

DROP TABLE IF EXISTS `g5__piree__category`;

CREATE TABLE IF NOT EXISTS `g5__piree__category` (
  `cate_row_n` INT(11) NOT NULL AUTO_INCREMENT,
  `cate_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `cate_1_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `cate_2_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `cate_n_p` VARCHAR(255) DEFAULT '0',


  `cate_name_l_s` VARCHAR(40) NOT NULL DEFAULT '',
  `cate_1_s` VARCHAR(40) NOT NULL DEFAULT '',
  `cate_2_s` VARCHAR(40) NOT NULL DEFAULT '',
  `cate_s_p` VARCHAR(255) DEFAULT '0',


  `cate_depth_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
  `cate_parent_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `cate_sub_t` INT(11) NOT NULL DEFAULT '0',
  `cate_row_t` INT(11) NOT NULL DEFAULT '0',
  `cate_member_t` INT(11) NOT NULL DEFAULT '0',
  `cate_article_t` INT(11) NOT NULL DEFAULT '0',

  `cate_regi_time_n` INT(11) NOT NULL DEFAULT '0',
  `cate_modi_time_n` INT(11) NOT NULL DEFAULT '0',
  `cate_relo_time_n` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY  (`cate_row_n`),
  KEY `k_reg_n` (`cate_n`),
  UNIQUE KEY `u_reg_n` (`cate_n`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `g5__piree__region`
--

DROP TABLE IF EXISTS `g5__piree__region`;

CREATE TABLE IF NOT EXISTS `g5__piree__region` (
  `region_row_n` INT(11) NOT NULL AUTO_INCREMENT,
  `region_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `region_1_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `region_2_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `region_n_p` VARCHAR(255) DEFAULT '0',

  `region_l_s` VARCHAR(40) NOT NULL DEFAULT '',
  `region_s_s` VARCHAR(40) NOT NULL DEFAULT '',
  `region_1_s` VARCHAR(40) NOT NULL DEFAULT '',
  `region_2_s` VARCHAR(40) NOT NULL DEFAULT '',
  `region_s_p` VARCHAR(255) DEFAULT '0',

  `region_depth_n` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
  `region_parent_n` SMALLINT(6) NOT NULL DEFAULT '0',
  `region_sub_t` INT(11) NOT NULL DEFAULT '0',

  `region_row_t` INT(11) NOT NULL DEFAULT '0',
  `region_member_t` INT(11) NOT NULL DEFAULT '0',
  `region_article_t` INT(11) NOT NULL DEFAULT '0',

  `region_regi_time_n` INT(11) NOT NULL DEFAULT '0',
  `region_modi_time_n` INT(11) NOT NULL DEFAULT '0',
  `region_relo_time_n` INT(11) NOT NULL DEFAULT '0',

  PRIMARY KEY  (`region_row_n`),
  KEY `k_reg_n` (`region_n`),
  UNIQUE KEY `u_reg_n` (`region_n`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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