ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 11672


Ignore:
Timestamp:
May 18, 2009, 4:37:47 PM (13 years ago)
Author:
fukamachi
Message:

DBコンバータ - インストール時に入力されたデータ(管理者アカウントなど)を削除させる

Location:
OpenPNE/branches/work/fukamachi/db_converter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/fukamachi/db_converter/db_converter.php

    r11594 r11672  
    3434// 対応表からSQLを生成
    3535$insert_ary = array();
     36$delete_ary = array();
    3637foreach ($sql_list as $sql) {
     38    if (array_key_exists('clear', $sql) && $sql['clear'] === 1) {
     39        array_push($delete_ary, clear_record_installed($sql['table']));
     40    }
     41
    3742    $insert;
    3843    if (array_key_exists('special', $sql) && $sql['special'] === 1) {
     
    4651
    4752// とりあえず出力
     53print_r($delete_ary);
    4854print_r($insert_ary);
    4955
     
    162168}
    163169
     170/******************************
     171 * インストールレコードの削除 *
     172 ******************************/
     173
     174function clear_record_installed($table)
     175{
     176    return 'DELETE FROM `'.$table.'`';
     177}
    164178
    165179/**********************
  • OpenPNE/branches/work/fukamachi/db_converter/db_relation.yml

    r11594 r11672  
    11- table: admin_user
    22  column: [id, username, password]
     3  clear: 1
    34  sql: >
    45    SELECT
     
    4445- table: community_category
    4546  special: 1
     47  clear: 1
    4648  column: [id, lft_key, rht_key, tree_key, name, sort_order, is_allow_member_community]
    4749  sql1: >
     
    278280- table: member
    279281  special: 1
     282  clear: 1
    280283  column: [id, name, is_active, invite_member_id, created_at, updated_at]
    281284  sql1: >
     
    299302- table: member_config
    300303  special: 1
     304  clear: 1
    301305  column: [id, member_id, name, value]
    302306  sql: >
     
    353357- table: member_profile
    354358  special: 1
     359  clear: 1
    355360  # public_flag は3.0.3以降で実装
    356361  column: [id, lft_key, rht_key, tree_key, member_id, profile_id, profile_option_id, value, public_flag]
     
    497502
    498503- table: profile
     504  clear: 1
    499505  column: [id, name, is_required, is_unique, form_type, value_type, value_regexp, value_min, value_max, is_disp_regist, is_disp_config, is_disp_search, sort_order]
    500506  sql: >
     
    516522
    517523- table: profile_option
     524  clear: 1
    518525  column: [id, profile_id, sort_order]
    519526  sql: >
Note: See TracChangeset for help on using the changeset viewer.