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
8 changes: 3 additions & 5 deletions src/dbup-firebird/FirebirdConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using DbUp.Engine.Transactions;
Expand All @@ -19,10 +19,7 @@ public class FirebirdConnectionManager : DatabaseConnectionManager
{
}

/// <summary>
/// Splits the statements in the script using the ";" character.
/// </summary>
/// <param name="scriptContents">The contents of the script to split.</param>
/// <inheritdoc/>
public override IEnumerable<string> SplitScriptIntoCommands(string scriptContents)
{
// TODO: Possible Change - this is the PostGres version
Expand All @@ -35,6 +32,7 @@ public override IEnumerable<string> SplitScriptIntoCommands(string scriptContent
return scriptStatements;
}

/// <inheritdoc/>
protected override AllowedTransactionMode AllowedTransactionModes => AllowedTransactionMode.TransactionPerScript;
}
}
5 changes: 4 additions & 1 deletion src/dbup-firebird/FirebirdObjectParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DbUp.Support;
using DbUp.Support;

namespace DbUp.Firebird
{
Expand All @@ -7,6 +7,9 @@ namespace DbUp.Firebird
/// </summary>
public class FirebirdObjectParser : SqlObjectParser
{
/// <summary>
/// Initializes a new instance of the <see cref="FirebirdObjectParser"/> class.
/// </summary>
public FirebirdObjectParser() : base("\"", "\"")
{
}
Expand Down
6 changes: 4 additions & 2 deletions src/dbup-firebird/FirebirdScriptExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using DbUp.Engine;
using DbUp.Engine.Output;
Expand All @@ -21,13 +21,14 @@ public class FirebirdScriptExecutor : ScriptExecutor
/// <param name="schema">The schema that contains the table.</param>
/// <param name="variablesEnabled">Function that returns <c>true</c> if variables should be replaced, <c>false</c> otherwise.</param>
/// <param name="scriptPreprocessors">Script Preprocessors in addition to variable substitution</param>
/// <param name="journalFactory">Database journal</param>
/// <param name="journal">Database journal</param>
public FirebirdScriptExecutor(Func<IConnectionManager> connectionManagerFactory, Func<IUpgradeLog> log, string schema, Func<bool> variablesEnabled,
IEnumerable<IScriptPreprocessor> scriptPreprocessors, Func<IJournal> journal)
: base(connectionManagerFactory, new FirebirdObjectParser(), log, schema, variablesEnabled, scriptPreprocessors, journal)
{
}

/// <inheritdoc/>
protected override string GetVerifySchemaSql(string schema)
{
throw new NotSupportedException();
Expand All @@ -39,6 +40,7 @@ protected override string GetVerifySchemaSql(string schema)
/// </summary>
protected override bool UseTheSameTransactionForJournalTableAndScripts => false;

/// <inheritdoc/>
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
{
try
Expand Down
7 changes: 6 additions & 1 deletion src/dbup-firebird/FirebirdTableJournal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Data;
using DbUp.Engine;
using DbUp.Engine.Output;
Expand Down Expand Up @@ -51,6 +51,7 @@ void ExecuteCommand(Func<IDbCommand> dbCommandFactory, string sql)
}
}

/// <inheritdoc/>
protected override void OnTableCreated(Func<IDbCommand> dbCommandFactory)
{
var unquotedTableName = UnquoteSqlObjectName(FqSchemaTableName);
Expand All @@ -60,21 +61,25 @@ protected override void OnTableCreated(Func<IDbCommand> dbCommandFactory)
Log().LogInformation($"The {TriggerName(unquotedTableName)} trigger has been created");
}

/// <inheritdoc/>
protected override string DoesTableExistSql()
{
return $"select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = '{UnquotedSchemaTableName}'";
}

/// <inheritdoc/>
protected override string GetInsertJournalEntrySql(string @scriptName, string @applied)
{
return $"insert into {FqSchemaTableName} (ScriptName, Applied) values ({scriptName}, {applied})";
}

/// <inheritdoc/>
protected override string GetJournalEntriesSql()
{
return $"select ScriptName from {FqSchemaTableName} order by ScriptName";
}

/// <inheritdoc/>
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
{
return
Expand Down
3 changes: 2 additions & 1 deletion src/dbup-firebird/dbup-firebird.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds Firebird support.</Description>
Expand All @@ -15,6 +15,7 @@
<RepositoryUrl>https://github.com/DbUp/dbup-firebird.git</RepositoryUrl>
<PackageIcon>dbup-icon.png</PackageIcon>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'true'">
Expand Down