/// <summary> /// Outputs statements for creation of views. /// </summary> public static void Create(StreamWriter writer, [NullGuard.AllowNull] PgSchema oldSchema, PgSchema newSchema, SearchPathHelper searchPathHelper) { foreach (PgView newView in newSchema.Views) { if (oldSchema == null || !oldSchema.ContainsView(newView.Name) || IsViewModified(oldSchema.GetView(newView.Name), newView)) { searchPathHelper.OutputSearchPath(writer); writer.WriteLine(); writer.WriteLine(newView.CreationSQL); } } }
public static void CreateViews(TextWriter writer, PgSchema oldSchema, PgSchema newSchema, SearchPathHelper searchPathHelper) { foreach (var newView in newSchema.GetViews()) { if (oldSchema == null || !oldSchema.ContainsView(newView.Name) || IsViewModified( oldSchema.GetView(newView.Name), newView)) { searchPathHelper.OutputSearchPath(writer); writer.WriteLine(); writer.WriteLine(newView.GetCreationSql()); } } }