Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
233
application/migrations/20170101000000_api.php
Normal file
233
application/migrations/20170101000000_api.php
Normal file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_api extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
|
||||
// api_error_log table
|
||||
$this->dbforge->add_field(array(
|
||||
'el_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'el_ip' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '접근 아이피',
|
||||
),
|
||||
'el_self' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '주소',
|
||||
),
|
||||
'el_vars' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '인자',
|
||||
),
|
||||
'el_result' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '결과',
|
||||
),
|
||||
'el_regdate' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '실행시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('el_idx', TRUE);
|
||||
$this->dbforge->create_table('api_error_log');
|
||||
|
||||
|
||||
// api_input table
|
||||
$this->dbforge->add_field(array(
|
||||
'ai_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'api_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => '0',
|
||||
'comment' => 'API PK',
|
||||
),
|
||||
'ai_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '입력 이름',
|
||||
),
|
||||
'ai_type' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '입력 종류',
|
||||
),
|
||||
'ai_value' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '입력 값',
|
||||
),
|
||||
'ai_ness' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '필수 입력 여부',
|
||||
),
|
||||
'ai_exp' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '설명',
|
||||
),
|
||||
'ai_sort' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => '0',
|
||||
'comment' => '정렬',
|
||||
),
|
||||
'ai_bigo' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '비고',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('ai_idx', TRUE);
|
||||
$this->dbforge->create_table('api_input');
|
||||
|
||||
|
||||
|
||||
// api_list table
|
||||
$this->dbforge->add_field(array(
|
||||
'api_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'api_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => 'API 이름',
|
||||
),
|
||||
'api_exp' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '설명',
|
||||
),
|
||||
'api_url' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '주소',
|
||||
),
|
||||
'api_method' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '10',
|
||||
'default' => '',
|
||||
'comment' => 'METHOD',
|
||||
),
|
||||
'api_use' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => '1',
|
||||
'comment' => '사용여부',
|
||||
),
|
||||
'api_bigo' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '비고설명',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('api_idx', TRUE);
|
||||
$this->dbforge->create_table('api_list');
|
||||
|
||||
|
||||
// api_output table
|
||||
$this->dbforge->add_field(array(
|
||||
'ai_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'api_idx' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => '0',
|
||||
'comment' => 'API PK',
|
||||
),
|
||||
'ai_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '설명',
|
||||
),
|
||||
'ai_type' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '입력 종류',
|
||||
),
|
||||
'ai_value' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '입력 값',
|
||||
),
|
||||
'ai_ness' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '필수 입력 여부',
|
||||
),
|
||||
'ai_exp' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '설명',
|
||||
),
|
||||
'ai_sort' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => '0',
|
||||
'comment' => '정렬',
|
||||
),
|
||||
'ai_bigo' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '비고',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('ai_idx', TRUE);
|
||||
$this->dbforge->create_table('api_output');
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dbforge->drop_table('api_error_log');
|
||||
$this->dbforge->drop_table('api_input');
|
||||
$this->dbforge->drop_table('api_list');
|
||||
$this->dbforge->drop_table('api_output');
|
||||
}
|
||||
}
|
||||
710
application/migrations/20170101000001_apps.php
Normal file
710
application/migrations/20170101000001_apps.php
Normal file
@@ -0,0 +1,710 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_apps extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
|
||||
// apps table
|
||||
$this->dbforge->add_field(array(
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_package' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '패키지명',
|
||||
),
|
||||
'app_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '어플 이름',
|
||||
),
|
||||
'app_sort' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '정렬순서',
|
||||
),
|
||||
'app_policy' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '개인정보취급방침',
|
||||
),
|
||||
'app_created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '생성시간',
|
||||
),
|
||||
'app_updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '업데이트시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('app_id', TRUE);
|
||||
$this->dbforge->create_table('apps');
|
||||
|
||||
|
||||
// contents_category table
|
||||
$this->dbforge->add_field(array(
|
||||
'cat_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'cat_parent' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '부모 카테고리',
|
||||
),
|
||||
'cat_depth' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '차수',
|
||||
),
|
||||
'cat_code' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '100',
|
||||
'default' => '',
|
||||
'comment' => '카테고리코드',
|
||||
),
|
||||
'cat_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '카테고리명',
|
||||
),
|
||||
'cat_publish_time' => array(
|
||||
'type' => 'time',
|
||||
'null' => true,
|
||||
'comment' => '발행예약시간',
|
||||
),
|
||||
'cat_sort' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '정렬순서',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('cat_id', TRUE);
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->add_key('cat_code');
|
||||
$this->dbforge->add_key('cat_sort');
|
||||
$this->dbforge->create_table('contents_category');
|
||||
|
||||
|
||||
// contents table
|
||||
$this->dbforge->add_field(array(
|
||||
'con_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'con_sort' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '정렬순서',
|
||||
),
|
||||
'cat1_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '1차 카테고리 PK',
|
||||
),
|
||||
'cat2_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '2차 카테고리 PK',
|
||||
),
|
||||
'cat3_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '3차 카테고리 PK',
|
||||
),
|
||||
'cat4_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '4차 카테고리 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '회원 PK',
|
||||
),
|
||||
'user_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 100,
|
||||
'null' => true,
|
||||
'comment' => '작성자명',
|
||||
),
|
||||
'con_title' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '제목',
|
||||
),
|
||||
'con_content' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '내용',
|
||||
),
|
||||
'crawl_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '수집목록 PK',
|
||||
),
|
||||
'con_origin_url' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '원글주소',
|
||||
),
|
||||
'con_hit' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '조회수',
|
||||
),
|
||||
'con_created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '생성시간',
|
||||
),
|
||||
'con_updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '업데이트시간',
|
||||
),
|
||||
'con_published_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '발행시간',
|
||||
),
|
||||
'is_open' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '발행여부',
|
||||
),
|
||||
'is_del' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '삭제여부',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('con_id', TRUE);
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->add_key('con_sort');
|
||||
$this->dbforge->add_key('cat_id');
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('contents');
|
||||
|
||||
|
||||
|
||||
// contents_comment table
|
||||
$this->dbforge->add_field(array(
|
||||
'com_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'con_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '컨텐츠 PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'con_user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '컨텐츠 작성자 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '댓글 작성자 PK',
|
||||
),
|
||||
'com_content' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '댓글내용',
|
||||
),
|
||||
'com_created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '생성시간',
|
||||
),
|
||||
'com_updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '업데이트시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('com_id', TRUE);
|
||||
$this->dbforge->add_key('con_id');
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('contents_comment');
|
||||
|
||||
|
||||
// contents_like table
|
||||
$this->dbforge->add_field(array(
|
||||
'like_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'con_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '컨텐츠 PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => 'Like 한 회원 PK',
|
||||
),
|
||||
'user_token' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => TRUE,
|
||||
'comment' => 'Like 한 회원 TOKEN',
|
||||
),
|
||||
'target_user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => 'Like 당한 회원 PK',
|
||||
),
|
||||
'like_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '좋아요한 시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('like_id', TRUE);
|
||||
$this->dbforge->add_key('con_id');
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('contents_like');
|
||||
|
||||
|
||||
// contents_bookmark table
|
||||
$this->dbforge->add_field(array(
|
||||
'bookmark_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'con_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '컨텐츠 PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => 'Like 한 회원 PK',
|
||||
),
|
||||
'target_user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => 'Like 당한 회원 PK',
|
||||
),
|
||||
'bookmark_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '좋아요한 시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('bookmark_id', TRUE);
|
||||
$this->dbforge->add_key('con_id');
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('contents_bookmark');
|
||||
|
||||
// notice table
|
||||
$this->dbforge->add_field(array(
|
||||
'notice_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '작성한 회원 PK',
|
||||
),
|
||||
'user_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 100,
|
||||
'null' => true,
|
||||
'comment' => '작성자명',
|
||||
),
|
||||
'notice_title' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '공지제목',
|
||||
),
|
||||
'notice_content' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '공지내용',
|
||||
),
|
||||
'created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '작성 시간',
|
||||
),
|
||||
'updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '최종업데이트 시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('notice_id', TRUE);
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('notice');
|
||||
|
||||
|
||||
|
||||
// qna table
|
||||
$this->dbforge->add_field(array(
|
||||
'qna_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'user_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '작성한 회원 PK',
|
||||
),
|
||||
'user_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 100,
|
||||
'null' => true,
|
||||
'comment' => '작성자명',
|
||||
),
|
||||
'qna_title' => array(
|
||||
'type' => 'vARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '문의제목',
|
||||
),
|
||||
'qna_content' => array(
|
||||
'type' => 'TEXT',
|
||||
'null' => true,
|
||||
'comment' => '문의내용',
|
||||
),
|
||||
'created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '작성 시간',
|
||||
),
|
||||
'updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '최종업데이트 시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('qna_id', TRUE);
|
||||
$this->dbforge->add_key('user_id');
|
||||
$this->dbforge->create_table('qna');
|
||||
|
||||
|
||||
// contents_tag table
|
||||
$this->dbforge->add_field(array(
|
||||
'tag_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'con_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '컨텐츠 PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'tag_name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => TRUE,
|
||||
'comment' => '태그명',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('tag_id', TRUE);
|
||||
$this->dbforge->add_key('con_id');
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->create_table('contents_tag');
|
||||
|
||||
|
||||
|
||||
// fcm_result table
|
||||
$this->dbforge->add_field(array(
|
||||
'id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'sendto' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '5',
|
||||
'default' => '',
|
||||
'comment' => '발송대상',
|
||||
),
|
||||
'topic' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '100',
|
||||
'default' => '',
|
||||
'comment' => '토픽',
|
||||
),
|
||||
'user_token' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '토큰',
|
||||
),
|
||||
'title' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '제목',
|
||||
),
|
||||
'message' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '내용',
|
||||
),
|
||||
'message_id' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '20',
|
||||
'default' => '',
|
||||
'comment' => '메세지아이디',
|
||||
),
|
||||
'success' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'default' => 0,
|
||||
'comment' => '성공',
|
||||
),
|
||||
'failure' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'default' => 0,
|
||||
'comment' => '실패',
|
||||
),
|
||||
'response' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'default' => '',
|
||||
'comment' => '응답값',
|
||||
),
|
||||
'regdate' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '등록일',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('id', TRUE);
|
||||
$this->dbforge->create_table('fcm_result');
|
||||
|
||||
|
||||
|
||||
// crawl_list table
|
||||
$this->dbforge->add_field(array(
|
||||
'crawl_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'comment' => 'PK',
|
||||
),
|
||||
'app_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '앱 PK',
|
||||
),
|
||||
'cat_id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '카테고리 PK',
|
||||
),
|
||||
'crawl_title' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '제목',
|
||||
),
|
||||
'site_type' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 3,
|
||||
'unsigned' => TRUE,
|
||||
'default' => 0,
|
||||
'comment' => '사이트 종류',
|
||||
),
|
||||
'site_key' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => '크롤할주소',
|
||||
),
|
||||
'created_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '생성시간',
|
||||
),
|
||||
'updated_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '생성시간',
|
||||
),
|
||||
'latest_crawled_at' => array(
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => '최종 수집시간',
|
||||
),
|
||||
));
|
||||
$this->dbforge->add_key('crawl_id', TRUE);
|
||||
$this->dbforge->add_key('app_id');
|
||||
$this->dbforge->create_table('crawl_list');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
}
|
||||
87
application/migrations/20170101000002_sample.php
Normal file
87
application/migrations/20170101000002_sample.php
Normal file
File diff suppressed because one or more lines are too long
10
application/migrations/index.html
Normal file
10
application/migrations/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user