@@ -147,17 +147,53 @@ public static ModelBuilder ForNpgsqlUseIdentityColumns(
147147
148148 #region Extensions
149149
150+ /// <summary>
151+ /// Registers a PostgreSQL extension in the model.
152+ /// </summary>
153+ /// <param name="modelBuilder">The model builder in which to define the extension.</param>
154+ /// <param name="schema">The schema in which to create the extension.</param>
155+ /// <param name="name">The name of the extension to create.</param>
156+ /// <param name="version">The version of the extension.</param>
157+ /// <returns>
158+ /// The updated <see cref="ModelBuilder"/>.
159+ /// </returns>
160+ /// <remarks>
161+ /// See: https://www.postgresql.org/docs/current/external-extensions.html
162+ /// </remarks>
163+ /// <exception cref="ArgumentNullException"><paramref name="modelBuilder"/></exception>
164+ [ NotNull ]
150165 public static ModelBuilder HasPostgresExtension (
151166 [ NotNull ] this ModelBuilder modelBuilder ,
152- [ NotNull ] string name )
167+ [ CanBeNull ] string schema ,
168+ [ NotNull ] string name ,
169+ [ CanBeNull ] string version )
153170 {
154171 Check . NotNull ( modelBuilder , nameof ( modelBuilder ) ) ;
172+ Check . NullButNotEmpty ( schema , nameof ( schema ) ) ;
155173 Check . NotEmpty ( name , nameof ( name ) ) ;
156174
157- modelBuilder . Model . Npgsql ( ) . GetOrAddPostgresExtension ( name ) ;
175+ modelBuilder . Model . Npgsql ( ) . GetOrAddPostgresExtension ( schema , name , version ) ;
158176 return modelBuilder ;
159177 }
160178
179+ /// <summary>
180+ /// Registers a PostgreSQL extension in the model.
181+ /// </summary>
182+ /// <param name="modelBuilder">The model builder in which to define the extension.</param>
183+ /// <param name="name">The name of the extension to create.</param>
184+ /// <returns>
185+ /// The updated <see cref="ModelBuilder"/>.
186+ /// </returns>
187+ /// <remarks>
188+ /// See: https://www.postgresql.org/docs/current/external-extensions.html
189+ /// </remarks>
190+ /// <exception cref="ArgumentNullException"><paramref name="modelBuilder"/></exception>
191+ [ NotNull ]
192+ public static ModelBuilder HasPostgresExtension (
193+ [ NotNull ] this ModelBuilder modelBuilder ,
194+ [ NotNull ] string name )
195+ => modelBuilder . HasPostgresExtension ( null , name , null ) ;
196+
161197 #endregion
162198
163199 #region Enums
0 commit comments