protected void ScriptTableSchema(ITable table, IScriptWriter writer) { Throw.If(table, "table").IsNull(); Throw.If(writer, "writer").IsNull(); string tableName = DbObjectName.CreateDbObjectName(table); string msg = string.Format("Scripting {0} table schema", tableName); messageManager.OnScriptMessage(msg); SqlScript script = scriptBuilder.Create(table); writer.WriteTableScript(tableName, script.ToScript()); }
protected virtual void WriteTableSchemaScript(SqlTable table) { Throw.If(table).IsNull(); if (!exportParams.ScriptTableSchema) { return; } string sql = table.ScriptSchema(SqlScriptType.Create | SqlScriptType.Drop | SqlScriptType.Defaults | SqlScriptType.Comments | SqlScriptType.Permissions | SqlScriptType.PrimaryKey); writer.WriteTableScript(table.Name, sql); UpdateProgress(table.Name); }