Skip to content

Commit f426a28

Browse files
committed
Copied from main project
1 parent da6d224 commit f426a28

18 files changed

+927
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
DB Operation: Open connection
2+
Info: Beginning database upgrade
3+
Info: Checking whether journal table exists..
4+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
5+
DB Operation: Dispose command
6+
Info: Journal table does not exist
7+
Info: Executing Database Server script 'Script0001.sql'
8+
Info: Checking whether journal table exists..
9+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
10+
DB Operation: Dispose command
11+
Info: Creating the "schemaversions" table
12+
DB Operation: Execute non query command: CREATE SEQUENCE schemaversions_sequence
13+
DB Operation: Dispose command
14+
DB Operation: Execute non query command: CREATE TABLE schemaversions
15+
(
16+
schemaversionid NUMBER(10),
17+
scriptname VARCHAR2(255) NOT NULL,
18+
applied TIMESTAMP NOT NULL,
19+
CONSTRAINT PK_schemaversions PRIMARY KEY (schemaversionid)
20+
)
21+
DB Operation: Dispose command
22+
DB Operation: Execute non query command: CREATE OR REPLACE TRIGGER schemaversions_on_insert
23+
BEFORE INSERT ON schemaversions
24+
FOR EACH ROW
25+
BEGIN
26+
SELECT schemaversions_sequence.nextval
27+
INTO :new.schemaversionid
28+
FROM dual;
29+
END;
30+
31+
DB Operation: Dispose command
32+
Info: The "schemaversions" table has been created
33+
DB Operation: Execute non query command: script1contents
34+
DB Operation: Dispose command
35+
DB Operation: Create parameter
36+
Info: DB Operation: Add parameter to command: scriptName=Script0001.sql
37+
DB Operation: Create parameter
38+
Info: DB Operation: Add parameter to command: applied=<date>
39+
DB Operation: Execute non query command: insert into SCHEMAVERSIONS (ScriptName, Applied) values (:scriptName,:applied)
40+
DB Operation: Dispose command
41+
Info: Upgrade successful
42+
DB Operation: Dispose connection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
DB Operation: Open connection
2+
Info: Beginning database upgrade
3+
Info: Checking whether journal table exists..
4+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'TESTSCHEMAVERSIONS'
5+
DB Operation: Dispose command
6+
Info: Journal table does not exist
7+
Info: Executing Database Server script 'Script0001.sql'
8+
Info: Checking whether journal table exists..
9+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'TESTSCHEMAVERSIONS'
10+
DB Operation: Dispose command
11+
Info: Creating the "test"."TestSchemaVersions" table
12+
DB Operation: Execute non query command: CREATE SEQUENCE TestSchemaVersions_sequence
13+
DB Operation: Dispose command
14+
DB Operation: Execute non query command: CREATE TABLE TestSchemaVersions
15+
(
16+
schemaversionid NUMBER(10),
17+
scriptname VARCHAR2(255) NOT NULL,
18+
applied TIMESTAMP NOT NULL,
19+
CONSTRAINT PK_TestSchemaVersions PRIMARY KEY (schemaversionid)
20+
)
21+
DB Operation: Dispose command
22+
DB Operation: Execute non query command: CREATE OR REPLACE TRIGGER TestSchemaVersions_on_insert
23+
BEFORE INSERT ON TestSchemaVersions
24+
FOR EACH ROW
25+
BEGIN
26+
SELECT TestSchemaVersions_sequence.nextval
27+
INTO :new.schemaversionid
28+
FROM dual;
29+
END;
30+
31+
DB Operation: Dispose command
32+
Info: The "test"."TestSchemaVersions" table has been created
33+
DB Operation: Execute non query command: script1contents
34+
DB Operation: Dispose command
35+
DB Operation: Create parameter
36+
Info: DB Operation: Add parameter to command: scriptName=Script0001.sql
37+
DB Operation: Create parameter
38+
Info: DB Operation: Add parameter to command: applied=<date>
39+
DB Operation: Execute non query command: insert into TESTSCHEMAVERSIONS (ScriptName, Applied) values (:scriptName,:applied)
40+
DB Operation: Dispose command
41+
Info: Upgrade successful
42+
DB Operation: Dispose connection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
DB Operation: Open connection
2+
Info: Beginning database upgrade
3+
Info: Checking whether journal table exists..
4+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
5+
DB Operation: Dispose command
6+
Info: Journal table does not exist
7+
Info: Executing Database Server script 'Script0001.sql'
8+
Info: Checking whether journal table exists..
9+
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
10+
DB Operation: Dispose command
11+
Info: Creating the "schemaversions" table
12+
DB Operation: Execute non query command: CREATE SEQUENCE schemaversions_sequence
13+
DB Operation: Dispose command
14+
DB Operation: Execute non query command: CREATE TABLE schemaversions
15+
(
16+
schemaversionid NUMBER(10),
17+
scriptname VARCHAR2(255) NOT NULL,
18+
applied TIMESTAMP NOT NULL,
19+
CONSTRAINT PK_schemaversions PRIMARY KEY (schemaversionid)
20+
)
21+
DB Operation: Dispose command
22+
DB Operation: Execute non query command: CREATE OR REPLACE TRIGGER schemaversions_on_insert
23+
BEFORE INSERT ON schemaversions
24+
FOR EACH ROW
25+
BEGIN
26+
SELECT schemaversions_sequence.nextval
27+
INTO :new.schemaversionid
28+
FROM dual;
29+
END;
30+
31+
DB Operation: Dispose command
32+
Info: The "schemaversions" table has been created
33+
DB Operation: Execute non query command: print SubstitutedValue
34+
DB Operation: Dispose command
35+
DB Operation: Create parameter
36+
Info: DB Operation: Add parameter to command: scriptName=Script0001.sql
37+
DB Operation: Create parameter
38+
Info: DB Operation: Add parameter to command: applied=<date>
39+
DB Operation: Execute non query command: insert into SCHEMAVERSIONS (ScriptName, Applied) values (:scriptName,:applied)
40+
DB Operation: Dispose command
41+
Info: Upgrade successful
42+
DB Operation: Dispose connection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+

2+
namespace DbUp.Oracle
3+
{
4+
[System.ObsoleteAttribute()]
5+
public class OracleCommandReader : DbUp.Support.SqlCommandReader, System.IDisposable
6+
{
7+
public OracleCommandReader(string sqlText) { }
8+
protected override bool IsCustomStatement { get; }
9+
protected override void ReadCustomStatement() { }
10+
}
11+
public class OracleCommandSplitter
12+
{
13+
[System.ObsoleteAttribute()]
14+
public OracleCommandSplitter() { }
15+
public OracleCommandSplitter(char delimiter) { }
16+
public System.Collections.Generic.IEnumerable<string> SplitScriptIntoCommands(string scriptContents) { }
17+
}
18+
public class OracleConnectionManager : DbUp.Engine.Transactions.DatabaseConnectionManager, DbUp.Engine.Transactions.IConnectionManager
19+
{
20+
[System.ObsoleteAttribute("Use OracleConnectionManager(string, OracleCommandSplitter) and supply an appropriate command splitter instance.")]
21+
public OracleConnectionManager(string connectionString) { }
22+
public OracleConnectionManager(string connectionString, DbUp.Oracle.OracleCommandSplitter commandSplitter) { }
23+
public override System.Collections.Generic.IEnumerable<string> SplitScriptIntoCommands(string scriptContents) { }
24+
}
25+
public class OracleCustomDelimiterCommandReader : DbUp.Support.SqlCommandReader, System.IDisposable
26+
{
27+
public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) { }
28+
protected override bool IsCustomStatement { get; }
29+
protected override void ReadCustomStatement() { }
30+
}
31+
public static class OracleExtensions
32+
{
33+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
34+
[System.ObsoleteAttribute("Use OracleDatabaseWithDefaultDelimiter, OracleDatabaseWithSemicolonDelimiter or the OracleDatabase with the delimiter parameter instead, see https://github.com/DbUp/DbUp/pull/335")]
35+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
36+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
37+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager, string schema) { }
38+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, char delimiter) { }
39+
[System.ObsoleteAttribute("Use the parameter that takes a delimiter instead, see https://github.com/DbUp/DbUp/pull/335")]
40+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema) { }
41+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema, char delimiter) { }
42+
[System.ObsoleteAttribute("Use OracleDatabaseWithDefaultDelimiter, OracleDatabaseWithSemicolonDelimiter or the OracleDatabase with the delimiter parameter instead, see https://github.com/DbUp/DbUp/pull/335")]
43+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema, string delimiter) { }
44+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabaseWithDefaultDelimiter(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
45+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabaseWithSemicolonDelimiter(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
46+
}
47+
public class OracleObjectParser : DbUp.Support.SqlObjectParser, DbUp.Engine.ISqlObjectParser
48+
{
49+
public OracleObjectParser() { }
50+
}
51+
public class OraclePreprocessor : DbUp.Engine.IScriptPreprocessor
52+
{
53+
public OraclePreprocessor() { }
54+
public string Process(string contents) { }
55+
}
56+
public class OracleScriptExecutor : DbUp.Support.ScriptExecutor, DbUp.Engine.IScriptExecutor
57+
{
58+
public OracleScriptExecutor(System.Func<DbUp.Engine.Transactions.IConnectionManager> connectionManagerFactory, System.Func<DbUp.Engine.Output.IUpgradeLog> log, string schema, System.Func<bool> variablesEnabled, System.Collections.Generic.IEnumerable<DbUp.Engine.IScriptPreprocessor> scriptPreprocessors, System.Func<DbUp.Engine.IJournal> journalFactory) { }
59+
public override void Execute(DbUp.Engine.SqlScript script) { }
60+
protected override void ExecuteCommandsWithinExceptionHandler(int index, DbUp.Engine.SqlScript script, System.Action executeCommand) { }
61+
protected override string GetVerifySchemaSql(string schema) { }
62+
}
63+
public class OracleTableJournal : DbUp.Support.TableJournal, DbUp.Engine.IJournal
64+
{
65+
public static System.Globalization.CultureInfo English;
66+
public OracleTableJournal(System.Func<DbUp.Engine.Transactions.IConnectionManager> connectionManager, System.Func<DbUp.Engine.Output.IUpgradeLog> logger, string schema, string table) { }
67+
protected string CreateSchemaTableSequenceSql() { }
68+
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName) { }
69+
protected string CreateSchemaTableTriggerSql() { }
70+
protected override string DoesTableExistSql() { }
71+
public override void EnsureTableExistsAndIsLatestVersion(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
72+
protected System.Data.IDbCommand GetCreateTableSequence(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
73+
protected System.Data.IDbCommand GetCreateTableTrigger(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
74+
protected override string GetInsertJournalEntrySql(string scriptName, string applied) { }
75+
protected override string GetJournalEntriesSql() { }
76+
}
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+

2+
namespace DbUp.Oracle
3+
{
4+
[System.ObsoleteAttribute()]
5+
public class OracleCommandReader : DbUp.Support.SqlCommandReader, System.IDisposable
6+
{
7+
public OracleCommandReader(string sqlText) { }
8+
protected override bool IsCustomStatement { get; }
9+
protected override void ReadCustomStatement() { }
10+
}
11+
public class OracleCommandSplitter
12+
{
13+
[System.ObsoleteAttribute()]
14+
public OracleCommandSplitter() { }
15+
public OracleCommandSplitter(char delimiter) { }
16+
public System.Collections.Generic.IEnumerable<string> SplitScriptIntoCommands(string scriptContents) { }
17+
}
18+
public class OracleConnectionManager : DbUp.Engine.Transactions.DatabaseConnectionManager, DbUp.Engine.Transactions.IConnectionManager
19+
{
20+
[System.ObsoleteAttribute("Use OracleConnectionManager(string, OracleCommandSplitter) and supply an appropriate command splitter instance.")]
21+
public OracleConnectionManager(string connectionString) { }
22+
public OracleConnectionManager(string connectionString, DbUp.Oracle.OracleCommandSplitter commandSplitter) { }
23+
public override System.Collections.Generic.IEnumerable<string> SplitScriptIntoCommands(string scriptContents) { }
24+
}
25+
public class OracleCustomDelimiterCommandReader : DbUp.Support.SqlCommandReader, System.IDisposable
26+
{
27+
public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) { }
28+
protected override bool IsCustomStatement { get; }
29+
protected override void ReadCustomStatement() { }
30+
}
31+
public static class OracleExtensions
32+
{
33+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
34+
[System.ObsoleteAttribute("Use OracleDatabaseWithDefaultDelimiter, OracleDatabaseWithSemicolonDelimiter or the OracleDatabase with the delimiter parameter instead, see https://github.com/DbUp/DbUp/pull/335")]
35+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
36+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
37+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager, string schema) { }
38+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, char delimiter) { }
39+
[System.ObsoleteAttribute("Use the parameter that takes a delimiter instead, see https://github.com/DbUp/DbUp/pull/335")]
40+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema) { }
41+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema, char delimiter) { }
42+
[System.ObsoleteAttribute("Use OracleDatabaseWithDefaultDelimiter, OracleDatabaseWithSemicolonDelimiter or the OracleDatabase with the delimiter parameter instead, see https://github.com/DbUp/DbUp/pull/335")]
43+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString, string schema, string delimiter) { }
44+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabaseWithDefaultDelimiter(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
45+
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabaseWithSemicolonDelimiter(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }
46+
}
47+
public class OracleObjectParser : DbUp.Support.SqlObjectParser, DbUp.Engine.ISqlObjectParser
48+
{
49+
public OracleObjectParser() { }
50+
}
51+
public class OraclePreprocessor : DbUp.Engine.IScriptPreprocessor
52+
{
53+
public OraclePreprocessor() { }
54+
public string Process(string contents) { }
55+
}
56+
public class OracleScriptExecutor : DbUp.Support.ScriptExecutor, DbUp.Engine.IScriptExecutor
57+
{
58+
public OracleScriptExecutor(System.Func<DbUp.Engine.Transactions.IConnectionManager> connectionManagerFactory, System.Func<DbUp.Engine.Output.IUpgradeLog> log, string schema, System.Func<bool> variablesEnabled, System.Collections.Generic.IEnumerable<DbUp.Engine.IScriptPreprocessor> scriptPreprocessors, System.Func<DbUp.Engine.IJournal> journalFactory) { }
59+
public override void Execute(DbUp.Engine.SqlScript script) { }
60+
protected override void ExecuteCommandsWithinExceptionHandler(int index, DbUp.Engine.SqlScript script, System.Action executeCommand) { }
61+
protected override string GetVerifySchemaSql(string schema) { }
62+
}
63+
public class OracleTableJournal : DbUp.Support.TableJournal, DbUp.Engine.IJournal
64+
{
65+
public static System.Globalization.CultureInfo English;
66+
public OracleTableJournal(System.Func<DbUp.Engine.Transactions.IConnectionManager> connectionManager, System.Func<DbUp.Engine.Output.IUpgradeLog> logger, string schema, string table) { }
67+
protected string CreateSchemaTableSequenceSql() { }
68+
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName) { }
69+
protected string CreateSchemaTableTriggerSql() { }
70+
protected override string DoesTableExistSql() { }
71+
public override void EnsureTableExistsAndIsLatestVersion(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
72+
protected System.Data.IDbCommand GetCreateTableSequence(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
73+
protected System.Data.IDbCommand GetCreateTableTrigger(System.Func<System.Data.IDbCommand> dbCommandFactory) { }
74+
protected override string GetInsertJournalEntrySql(string scriptName, string applied) { }
75+
protected override string GetJournalEntriesSql() { }
76+
}
77+
}

src/Tests/DatabaseSupportTests.cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using DbUp.Builder;
2+
using DbUp.Oracle;
3+
using DbUp.Tests.Common;
4+
5+
namespace DbUp.Tests.Providers.Oracle;
6+
7+
public class DatabaseSupportTests : DatabaseSupportTestsBase
8+
{
9+
public DatabaseSupportTests() : base()
10+
{
11+
}
12+
13+
protected override UpgradeEngineBuilder DeployTo(SupportedDatabases to)
14+
=> to.OracleDatabaseWithDefaultDelimiter("");
15+
16+
protected override UpgradeEngineBuilder AddCustomNamedJournalToBuilder(UpgradeEngineBuilder builder, string schema, string tableName)
17+
=> builder.JournalTo(
18+
(connectionManagerFactory, logFactory)
19+
=> new OracleTableJournal(connectionManagerFactory, logFactory, schema, tableName)
20+
);
21+
}

src/Tests/NoPublicApiChanges.cs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using DbUp.Oracle;
2+
using DbUp.Tests.Common;
3+
4+
namespace DbUp.Tests.Providers.Oracle;
5+
6+
public class NoPublicApiChanges : NoPublicApiChangesBase
7+
{
8+
public NoPublicApiChanges()
9+
: base(typeof(OracleExtensions).Assembly)
10+
{
11+
}
12+
}

0 commit comments

Comments
 (0)