2 DROP TABLE IF EXISTS user_content_tab;
\r
3 CREATE TABLE user_content_tab (
\r
4 ub_serial INT AUTO_INCREMENT, -- レコードシリアル番号
\r
5 ub_id VARCHAR(40) DEFAULT '' NOT NULL, -- タブID
\r
6 ub_language_id VARCHAR(2) DEFAULT '' NOT NULL, -- 言語ID
\r
7 ub_history_index INT DEFAULT 0 NOT NULL, -- 履歴管理用インデックスNo(0~)
\r
9 ub_name VARCHAR(60) DEFAULT '' NOT NULL, -- 名称
\r
10 ub_description VARCHAR(80) DEFAULT '' NOT NULL, -- 説明
\r
11 ub_template_html TEXT NOT NULL, -- テンプレートHTML
\r
12 ub_use_item_id TEXT NOT NULL, -- 使用しているコンテンツ項目ID(カンマ区切り)
\r
13 ub_index INT DEFAULT 0 NOT NULL, -- ソート用
\r
14 ub_visible BOOLEAN DEFAULT true NOT NULL, -- 表示可否
\r
15 ub_user_limited BOOLEAN DEFAULT false NOT NULL, -- 参照ユーザを制限
\r
17 ub_create_user_id INT DEFAULT 0 NOT NULL, -- レコード作成者
\r
18 ub_create_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード作成日時
\r
19 ub_update_user_id INT DEFAULT 0 NOT NULL, -- レコード更新者
\r
20 ub_update_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード更新日時
\r
21 ub_deleted BOOLEAN DEFAULT false NOT NULL, -- レコード削除状態
\r
22 PRIMARY KEY (ub_serial),
\r
23 UNIQUE (ub_id, ub_language_id, ub_history_index)
\r
27 DROP TABLE IF EXISTS user_content_item;
\r
28 CREATE TABLE user_content_item (
\r
29 ui_serial INT AUTO_INCREMENT, -- レコードシリアル番号
\r
30 ui_id VARCHAR(40) DEFAULT '' NOT NULL, -- 項目ID
\r
31 ui_history_index INT DEFAULT 0 NOT NULL, -- 履歴管理用インデックスNo(0~)
\r
33 ui_name VARCHAR(40) DEFAULT '' NOT NULL, -- 名前
\r
34 ui_type INT DEFAULT 0 NOT NULL, -- コンテンツタイプ(0=HTML,1=文字列,2=数値)
\r
36 ui_create_user_id INT DEFAULT 0 NOT NULL, -- レコード作成者
\r
37 ui_create_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード作成日時
\r
38 ui_update_user_id INT DEFAULT 0 NOT NULL, -- レコード更新者
\r
39 ui_update_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード更新日時
\r
40 ui_deleted BOOLEAN DEFAULT false NOT NULL, -- レコード削除状態
\r
41 PRIMARY KEY (ui_serial),
\r
42 UNIQUE (ui_id, ui_history_index)
\r
46 DROP TABLE IF EXISTS user_content;
\r
47 CREATE TABLE user_content (
\r
48 uc_serial INT AUTO_INCREMENT, -- レコードシリアル番号
\r
49 uc_id VARCHAR(20) DEFAULT '' NOT NULL, -- コンテンツID
\r
50 uc_room_id VARCHAR(20) DEFAULT '' NOT NULL, -- コンテンツ所属ID
\r
51 uc_language_id VARCHAR(2) DEFAULT '' NOT NULL, -- 言語ID
\r
52 uc_history_index INT DEFAULT 0 NOT NULL, -- 履歴管理用インデックスNo(0~)
\r
54 uc_name VARCHAR(40) DEFAULT '' NOT NULL, -- コンテンツ名
\r
55 uc_description VARCHAR(100) DEFAULT '' NOT NULL, -- 説明
\r
56 uc_data TEXT NOT NULL, -- コンテンツデータ
\r
57 uc_data_search_num DECIMAL(15,4) DEFAULT 0 NOT NULL, -- コンテンツ検索用データ(数値)
\r
58 uc_visible BOOLEAN DEFAULT true NOT NULL, -- 表示可否
\r
59 uc_active_start_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- 表示可能期間(開始)
\r
60 uc_active_end_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- 表示可能期間(終了)
\r
61 uc_user_limited BOOLEAN DEFAULT false NOT NULL, -- 参照ユーザを制限
\r
63 uc_check_out_user_id INT DEFAULT 0 NOT NULL, -- チェックアウトユーザID(0のときはチェックイン状態)
\r
64 uc_check_out_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- チェックアウト日時
\r
65 uc_create_user_id INT DEFAULT 0 NOT NULL, -- レコード作成者
\r
66 uc_create_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード作成日時
\r
67 uc_update_user_id INT DEFAULT 0 NOT NULL, -- レコード更新者
\r
68 uc_update_dt TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, -- レコード更新日時
\r
69 uc_locked BOOLEAN DEFAULT false NOT NULL, -- レコードロック状態
\r
70 uc_deleted BOOLEAN DEFAULT false NOT NULL, -- レコード削除状態
\r
71 PRIMARY KEY (uc_serial),
\r
72 UNIQUE (uc_id, uc_room_id, uc_language_id, uc_history_index)
\r
76 DELETE FROM _widgets WHERE wd_id = 'user_content';
\r
77 INSERT INTO _widgets
\r
78 (wd_id, wd_name, wd_type, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_initialized, wd_cache_type, wd_view_control_type, wd_install_dt, wd_create_dt) VALUES
\r
79 ('user_content', 'ユーザ作成コンテンツ', 'user', '0.5.0', '株式会社 毎日メディアサービス', '株式会社 毎日メディアサービス', 'GPL', 10, 'ユーザが管理可能なコンテンツを表示', 'jquery-ui,jquery-ui-plus', '', true, true, 2, 2, now(), now());
\r