TShock/TShockAPI/DB/SqlColumn.cs
high 423a33325a Finished:
-sqlite altering
-implemented mysql
Todo:
-Merge SqlTableCreator into the querybuilders or make it static
-Make all the managers use the querybuilder for making tables. (See GroupManager.cs for an example)
-Implement more datatypes (see TypesAsStrings in IQueryBuilder.cs)
2011-08-03 18:37:42 -04:00

35 lines
870 B
C#

using MySql.Data.MySqlClient;
namespace TShockAPI.DB
{
public class SqlColumn
{
//Required
public string Name { get; set; }
public MySqlDbType Type { get; set; }
//Optional
public bool Unique { get; set; }
public bool Primary { get; set; }
public bool AutoIncrement { get; set; }
public bool NotNull { get; set; }
public string DefaultValue { get; set; }
/// <summary>
/// Length of the data type, null = default
/// </summary>
public int? Length { get; set; }
public SqlColumn(string name, MySqlDbType type)
: this(name, type, null)
{
}
public SqlColumn(string name, MySqlDbType type, int? length)
{
Name = name;
Type = type;
Length = length;
}
}
}