/// <summary>
        /// Outputs statements for dropping of functions that exist no more.
        /// </summary>
        public static void Drop(StreamWriter writer, [NullGuard.AllowNull] PgSchema oldSchema, PgSchema newSchema, SearchPathHelper searchPathHelper)
        {
            if (oldSchema == null)
            {
                return;
            }

            // Drop functions that exist no more
            foreach (PgFunction oldFunction in oldSchema.Functions)
            {
                if (!newSchema.ContainsFunction(oldFunction.Signature))
                {
                    searchPathHelper.OutputSearchPath(writer);
                    writer.WriteLine();
                    writer.WriteLine(oldFunction.DropSQL);
                }
            }
        }
Example #2
0
        public static void DropFunctions(TextWriter writer, PgDiffArguments arguments,
                                         PgSchema oldSchema, PgSchema newSchema, SearchPathHelper searchPathHelper)
        {
            if (oldSchema == null)
            {
                return;
            }

            // Drop functions that exist no more
            foreach (var oldFunction in oldSchema.GetFunctions())
            {
                if (!newSchema.ContainsFunction(oldFunction.GetSignature()))
                {
                    searchPathHelper.OutputSearchPath(writer);
                    writer.WriteLine();
                    writer.WriteLine(oldFunction.GetDropSql());
                }
            }
        }