実装したい機能によって必要なカラムは多様である。
例)入力してもらう項目を追加する
お問い合わせに対するリアクション履歴
お問い合わせのステータス
管理者にメールアドレスや住所などを入れて名簿化する
データの閲覧・変更履歴
etc...
#/*=============================================================================*/
#/* お問い合わせデータ */
#/*=============================================================================*/
create table tbl_contact(
id int not NULL auto_increment comment "自動インクリメントID",
name varchar(1024) comment "名前",
mail varchar(1024) comment "メールアドレス",
comment blob comment "お問い合わせ内容",
note blob comment "管理者用メモ",
dateupdate timestamp default current_timestamp on update current_timestamp comment "更新時",
dateadd timestamp default current_timestamp comment "登録時",
datedelete timestamp NULL default NULL comment "削除時",
#プライマリキー定義
primary key (id)
) engine=innodb auto_increment=1 default charset=utf8mb4;
#/*=============================================================================*/
#/* 管理者データ */
#/*=============================================================================*/
create table tbl_admin(
id int not NULL auto_increment comment "自動インクリメントID",
user_name varchar(1024) comment "ユーザー認識名",
user_id varchar(1024) comment "ユーザー名",
password varchar(1024) comment "ログインパスワード(不可逆hash)",
dateupdate timestamp default current_timestamp on update current_timestamp comment "更新時",
dateadd timestamp default current_timestamp comment "登録時",
datedelete timestamp NULL default NULL comment "削除時",
#プライマリキー定義
primary key (id)
) engine=innodb auto_increment=1 default charset=utf8mb4;