public void CreateMySqlTableTest() { dbMySqlMaintenance.Set(dbMySqlAccess); //创建表 dbMySqlMaintenance.CreateTable("DbMaintenanceTest", new List <DbColumnInfo>() { new DbColumnInfo() { ColumnName = "UserName", Length = 50 } }); Assert.AreEqual(true, dbMySqlMaintenance.ExistsTable("DbMaintenanceTest")); //更改列名 dbMySqlMaintenance.RenameColumn("DbMaintenanceTest", "UserName", "TestName"); Assert.AreEqual(true, dbMySqlMaintenance.ExistsColumn("DbMaintenanceTest", "TestName")); //更新列 dbMySqlMaintenance.UpdateColumn("DbMaintenanceTest", new DbColumnInfo() { ColumnName = "TestName", DataType = "int" }); Assert.AreEqual(true, dbMySqlMaintenance.ExistsColumn("DbMaintenanceTest", "TestName")); //删除表 dbMySqlMaintenance.DropTable("DbMaintenanceTest"); Assert.AreEqual(false, dbMySqlMaintenance.ExistsTable("DbMaintenanceTest")); }
public void CreateSqliteTableTest() { dbSqliteMaintenance.Set(dbSqliteAccess); //创建表 dbSqliteMaintenance.CreateTable("DbMaintenanceTest", new List <DbColumnInfo>() { new DbColumnInfo() { ColumnName = "UserName", Length = 50 } }); Assert.AreEqual(true, dbSqliteMaintenance.ExistsTable("DbMaintenanceTest")); //删除表 dbSqliteMaintenance.DropTable("DbMaintenanceTest"); Assert.AreEqual(false, dbSqliteMaintenance.ExistsTable("DbMaintenanceTest")); }