OSDN Git Service

データーベース名が別々だとうまく動かないので一つにまとめた
authorkonekoneko <jbh03215@hotmail.co.jp>
Fri, 16 Nov 2012 17:17:41 +0000 (02:17 +0900)
committerkonekoneko <jbh03215@hotmail.co.jp>
Fri, 16 Nov 2012 17:17:41 +0000 (02:17 +0900)
chat.js
init.sql
profile.js

diff --git a/chat.js b/chat.js
index 0f736d5..de151a2 100644 (file)
--- a/chat.js
+++ b/chat.js
@@ -149,7 +149,7 @@ function RoomInfomationCollection()
                                host     : config.db_host,\r
                                user     : config.db_user,\r
                                password : config.db_password,\r
-                               database : "configure",\r
+                               database : "webchat",\r
                        });\r
        var collection = {};\r
        this.Get = function(rno){\r
@@ -376,7 +376,7 @@ function IpBanCollecion()
                                host     : config.db_host,\r
                                user     : config.db_user,\r
                                password : config.db_password,\r
-                               database : "configure",\r
+                               database : "webchat",\r
                        });\r
        var collection = {};\r
        this.IsBaned = function(ip){\r
index f0d7b2b..f0089fe 100644 (file)
--- a/init.sql
+++ b/init.sql
@@ -3,8 +3,8 @@ grant select,
        delete,
        update on *.* to user identified by 'user';
 flush privileges;
-CREATE DATABASE IF NOT EXISTS profile;
-use profile;
+CREATE DATABASE IF NOT EXISTS webchat;
+use webchat;
 DROP TABLE IF EXISTS list;
 CREATE TABLE list(name VARCHAR(64) NOT NULL,
        age SMALLINT  UNSIGNED DEFAULT 0,
@@ -17,7 +17,6 @@ CREATE TABLE list(name VARCHAR(64) NOT NULL,
        etc TEXT,
        PRIMARY KEY(name));
 CREATE DATABASE IF NOT EXISTS configure;
-use configure;
 DROP TABLE IF EXISTS ipbanlist;
 CREATE TABLE ipbanlist(ip VARCHAR(64) NOT NULL,
        type CHAR(1));
index 06bc5d2..e0eb788 100644 (file)
@@ -96,7 +96,7 @@ function PrepaerListAsync(req,callback)
                }\r
        ],function(err,result){\r
                if(err != null){\r
-                       cb(err,null);\r
+                       callback(err,null);\r
                }else{\r
                        var next = start + limit;\r
                        var prev = start - limit;\r
@@ -265,6 +265,7 @@ function ProfileCollection()
                                host     : config.db_host,\r
                                user     : config.db_user,\r
                                password : config.db_password,\r
+                               port : config.db_port,\r
                                database : "profile",\r
                        });\r
        this.AuthAsync = function(name,password,cb){\r