if (schemaObject is TableSchema)
{
TableSchema tableSchema = schemaObject as TableSchema;
string commandText = string.Format(@"SHOW CREATE TABLE `{0}`.`{1}`", tableSchema.Database.Name, tableSchema.Name);
using (DbConnection connection = CreateConnection(connectionString))
{
connection.Open();
DbCommand command = connection.CreateCommand();
command.CommandText = commandText;
command.Connection = connection;
using (IDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
{
while (reader.Read())
{
string createtable = reader.GetString(1);
extendedProperties.Add(new ExtendedProperty("CS_CreateTableScript", createtable, DbType.String));
}
if (!reader.IsClosed)
reader.Close();
}
if (connection.State != ConnectionState.Closed)
connection.Close();
}
}