Adds MySql Support

This commit is contained in:
Twitchy 2011-07-12 13:31:36 +12:00
parent 0997b5bd5d
commit 3e17e42a37
11 changed files with 96 additions and 30 deletions

View file

@ -40,8 +40,13 @@ namespace TShockAPI.DB
using (var com = database.CreateCommand())
{
com.CommandText =
"CREATE TABLE IF NOT EXISTS 'Warps' ('X' NUMERIC, 'Y' NUMERIC, 'WarpName' TEXT UNIQUE, 'WorldID' TEXT);";
if (TShock.Config.StorageType.ToLower() == "sqlite")
com.CommandText =
"CREATE TABLE IF NOT EXISTS 'Warps' ('X' NUMERIC, 'Y' NUMERIC, 'WarpName' TEXT UNIQUE, 'WorldID' TEXT);";
else if (TShock.Config.StorageType.ToLower() == "mysql")
com.CommandText =
"CREATE TABLE IF NOT EXISTS Warps (X INT(11), Y INT(11), WarpName VARCHAR(255) UNIQUE, WorldID VARCHAR(255));";
com.ExecuteNonQuery();
}
}