using SQLite;

namespace StreamBuddy.PluginInterface.DB
{
    /// <summary>
    /// Values stored per user in a stream
    /// </summary>
    public class UserValue
    {
        [AutoIncrement, PrimaryKey]
        public int ID { get; set; }

        /// <summary>
        /// The user in the stream, lowercased.
        /// </summary>
        [Indexed(Name = "UserValueID", Order = 0, Unique = true), NotNull, Collation("nocase")]
        public string Nick { get; set; }
        /// <summary>
        /// The name of the value, lowercased.
        /// </summary>
        [Indexed(Name = "UserValueID", Order = 1, Unique = true), NotNull, Collation("nocase")]
        public string ValueName { get; set; }

        /// <summary>
        /// The stored value, as a string.
        /// </summary>
        public string Value { get; set; }

		public override string ToString()
		{
			return string.Format("{0}.{1}='{2}'", Nick, ValueName, Value);
		}
    }
}
