コード例 #1
0
        /// <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);
                }
            }
        }
コード例 #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());
                }
            }
        }