Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Marten.CommandLine/Marten.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PackageReference Include="JasperFx.CodeGeneration.Commands" Version="3.7.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Oakton" Version="6.3.0" />
<PackageReference Include="Weasel.CommandLine" Version="7.13.2" />
<PackageReference Include="Weasel.CommandLine" Version="7.14.2" />
</ItemGroup>
<Import Project="../../Analysis.Build.props"/>
</Project>
2 changes: 1 addition & 1 deletion src/Marten/Marten.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PackageReference Include="Polly.Core" Version="8.5.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Weasel.Postgresql" Version="7.14.1" />
<PackageReference Include="Weasel.Postgresql" Version="7.14.2" />
</ItemGroup>

<!--SourceLink specific settings-->
Expand Down
2 changes: 2 additions & 0 deletions src/Marten/Storage/IMartenDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public interface IMartenDatabase: IDatabase, IConnectionSource<NpgsqlConnection>
/// </summary>
ISequences Sequences { get; }

ISequences BuildSequencesForMigration();


IProviderGraph Providers { get; }

Expand Down
7 changes: 7 additions & 0 deletions src/Marten/Storage/MartenDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ string identifier

public ISequences Sequences => _sequences.Value;

public ISequences BuildSequencesForMigration()
{
if (_sequences.IsValueCreated) return _sequences.Value;

return new SequenceFactory(Options, this);
}

public IProviderGraph Providers { get; }

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Marten/Storage/StandinDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ public Task ResetHiloSequenceFloor<T>(long floor)
}

public ISequences Sequences { get; }
public ISequences BuildSequencesForMigration()
{
throw new NotImplementedException();
}

public IProviderGraph Providers { get; }
public ShardStateTracker? Tracker { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/Marten/Storage/StorageFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ internal IEnumerable<IFeatureSchema> AllActiveFeatures(IMartenDatabase database)

if (SequenceIsRequired())
{
yield return database.Sequences;
yield return database.BuildSequencesForMigration();
}

if (_options.Events.As<EventGraph>().IsActive(_options))
Expand Down
4 changes: 3 additions & 1 deletion src/Marten/Storage/SystemFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public SystemFunction(StoreOptions options, string functionName, string args, bo
}

public SystemFunction(string schema, string functionName, string args, bool isRemoved = false)
: base(new PostgresqlObjectName(schema, functionName))
: base(new PostgresqlObjectName(schema, functionName), SchemaBuilder.GetSqlScript(schema, functionName), [$"drop function if exists {schema}.{functionName}({args});"])
{
IsRemoved = isRemoved;
_args = args;
Expand All @@ -33,4 +33,6 @@ public override void WriteCreateStatement(Migrator rules, TextWriter writer)
writer.WriteLine(body);
writer.WriteLine("");
}


}
Loading