private SQL.DataClasses.Table SetupAuditTables(SQL.DataClasses.Table Table) { SQL.DataClasses.Table AuditTable = new Utilities.SQL.DataClasses.Table(Table.Name + "Audit", Table.ParentDatabase); AuditTable.AddColumn("ID", DbType.Int32, 0, false, true, true, true, false, "", "", 0); AuditTable.AddColumn("AuditType", SqlDbType.NVarChar.ToDbType(), 1, false, false, false, false, false, "", "", ""); foreach (SQL.DataClasses.Interfaces.IColumn Column in Table.Columns) { AuditTable.AddColumn(Column.Name, Column.DataType, Column.Length, Column.Nullable, false, false, false, false, "", "", ""); } return(AuditTable); }
public void AddColumns() { Utilities.SQL.DataClasses.Database Database = new Utilities.SQL.DataClasses.Database("TestDatabase"); Utilities.SQL.DataClasses.Table Table = Database.AddTable("TestTable"); IColumn Column = Table.AddColumn <int>("Column1", DbType.Int32); Assert.Equal(Column, Table.Columns[0]); Assert.Equal("Column1", Column.Name); Assert.Equal(DbType.Int32, Column.DataType); Assert.Equal("", Column.Default); }
private SQL.DataClasses.Table SetupAuditTables(SQL.DataClasses.Table Table) { SQL.DataClasses.Table AuditTable = new Utilities.SQL.DataClasses.Table(Table.Name + "Audit", Table.ParentDatabase); AuditTable.AddColumn("ID", DbType.Int32, 0, false, true, true, true, false, "", "", 0); AuditTable.AddColumn("AuditType", SqlDbType.NVarChar.ToDbType(), 1, false, false, false, false, false, "", "", ""); foreach (SQL.DataClasses.Interfaces.IColumn Column in Table.Columns) AuditTable.AddColumn(Column.Name, Column.DataType, Column.Length, Column.Nullable, false, false, false, false, "", "", ""); return AuditTable; }