by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Robert Wagner
    @droyad
    @andrewdj I will check it in the morning. But it should say NOT to use Use at the top of the script
    There should be a Folder aware script provider bundled
    Andrew Johns
    @andrewdj

    I can't find where I saw it now, sadly. I'll try this structure tonight and see how I get on.

    Do you think it's sensible to keep the constraints separate to the table creation as I've suggested? That way it ensures all the necessary tables are in place before foreign keys are added.

    Robert Wagner
    @droyad
    Sorry, I re-read that. Yeh you could do that, the EmbeddedScriptProvider will sort things alphabetically so it will run them in the desired order
    However, I think if you keep your Table, Indexes and Constraints separated you will run into trouble in the future. With that structure, it may mean you can upgrade from version 0 to N, or N-1 to N, but you'll run into conflicts when upgrading say N-10 to N
    The schema (DDL) migration scripts should be a linear, identical* process that every DB you update follows.
    * Except when you have branches (hopefully short lived) that make changes and then are merged (however from my experience, it is uncommon to have a conflict)
    Robert Wagner
    @droyad
    For your other scripts, that do not change structure and do not influence how the structure can be changed (Functions, Sprocs, etc), make them repeatable, and run them every time using WithNoJournal
    Andrew Johns
    @andrewdj
    the separation was more for the first run, after that migrations would be single scripts that applied all the necessary changes for a particular update
    Joe Phillips
    @phillijw
    seems this is kinda out of date: https://github.com/DbUp/DbUp/releases
    Lars A Brekken
    @larsbrekken
    Hi guys, just a heads up that I added a PR for Amazon Redshift support (DbUp/DbUp#350) and an associated issue (https://github.com/DbUp/DbUp/issues/352). Would appreciate feedback on the approach and please let me know if there's anything I can improve in order to get it considered for being merged.
    João Paulo dos Santos Portela
    @joaoportela
    Hi! I'm looking for the docs that describes the ordering of the migrations when using WithScriptsEmbdeddedInAssembly. Does anyone know where it is?
    I'm assuming it's simple "string" ordering, right?
    Lars A Brekken
    @larsbrekken
    @joaoportela Yes, I believe that it orders it by script name. See https://github.com/DbUp/DbUp/blob/master/src/dbup-core/ScriptProviders/EmbeddedScriptsProvider.cs#L46
    João Paulo dos Santos Portela
    @joaoportela
    thanks, 👍
    strange2202
    @strange2202
    Has anyone used the dbup-oracle? I have used dbup and dbup-postgres and have had no issues but having trouble setting up UpgradeEngine for Oracle
    Luis Alberto Carvajal Martinez
    @carvajalluis
    Hello everybody, is there a way to use dbup with mongodb?
    Jojo Aquino
    @jfaquinojr
    Hows your experience with sqlite? I plan to use this for my side project but not really sure how this will fare against something like sqlite.
    Andrew Johns
    @andrewdj
    @jfaquinojr I was using DBUp to produce scripts that deploy to SQLLite for running local tests. It worked for inline SQL with no trouble for me. It was the Stored Procedures that wouldn't work, but that's because SQLite doesn't support SPs. I presume you already know this if you're using SQLite. :)
    Jojo Aquino
    @jfaquinojr
    @andrewdj awesome! I am not using stored procedures so, I guess there's no reason for me not to use dbup then
    Matthijs ter Woord
    @mterwoord
    Hi All! Is this chat still active?
    I'm wondering if its possible to have multiple sets of dbup scripts (and versions) inside 1 database/app?
    Matthijs ter Woord
    @mterwoord
    Got it. can do it on mssql with different schema's. works for me!
    Don Waldo
    @dgwaldo
    Any ideas on Invalid object name 'dbo.SchemaVersions'.??

    I found all the issues related to that... DbUp/DbUp#142 & DbUp/DbUp#346

    I'm using 4.3.1. with EnsureDatabase.For.SqlDatabase(connectionString); Then I run a script that does a bunch of alter statements.

    Don Waldo
    @dgwaldo
    nuget package version only goes back to 4.0.0
    Matthijs ter Woord
    @mterwoord
    that message is an error i guess it uses to see if it exists. does it give you an issue?
    Don Waldo
    @dgwaldo
    yah, the table never gets a journal entry, the table dbo.SchemaVersions does exist in the db when it's created.
    Don Waldo
    @dgwaldo
    Ok I think I found this issue
    this was at the end of my update script
    --USE [master]
    --GO
    --ALTER DATABASE [Test_CompanyDb] SET READ_WRITE
    --GO
    Ryan Paredes
    @RyanP741_gitlab
    Hello everyone. Got a quick question that I couldn't find any info on if it's possible or any possible workarounds. Basically, I'm running DbUp from PowerShell and have it working from the given example in the Usage section of the docs, but I'm wondering if there's a way to simulate the "NullJournal" functionality from PowerShell. Is it possible?
    Jeffry S. Rubaya
    @angelumDei19
    Hi everyone, can you confirm if DbUp has feature wherein it will check if the script in the current directory is modified, for example, a stored procedures, then rerun the said script even it is already available in the dbo.SchemaVersions ?
    Adrian Clark
    @AdrianJSClark
    Not by default. I have written a script provider in the past which appended the hash of the script content to the name of the script returned to DbUp for comparison. If the script names differ then the script is executed, so in that case the contents would change so the hash would change and you have your script run again.
    Another common thing is to have stored procedures written in idempotent scripts then use the "NullJournal" so that they execute every time. You just need to set up a separate upgrader for that (because you can only have a single journaller per upgrader).
    Davi Rodrigues
    @davirod
    Hi all, how are we today?! Got a, probably for you, simple question...I am using dbup-mysql for dotnet core and the Journal table is not being created. Is there any sample script where I can instantiate properly a MySqlTableJournal?

    I was trying to do something like this:

    var upgradeEngine = DeployChanges.To .MySqlDatabase(Helpers.Utils.GetRDSConnectionString(ConfigurationService)) .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly()) .LogToConsole() .WithTransaction() .JournalTo(new MySqlTableJournal(() => new MySqlConnectionManager(Helpers.Utils.GetRDSConnectionString(ConfigurationService)), () => new CaptureLogsLogger(), "meta", "schemaversions")) .Build();

    but it doesn't seem to work
    yuanfei
    @yuanfei_gitlab
    anyone tried cloud storage provider?
    everfor
    @everfor007_twitter
    Does dbup support the Azure SQL Datawarehouse DB?

    [error]Script block number: -1; Message: Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement.

    [error]System.Data.SqlClient.SqlException (0x80131904): Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement.
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    program.cs
    using DbUp; using System;
    using System.Configuration;
    using System.Reflection;

    namespace MIReport.Warehouse
    {
    class Program
    {
    static int Main(string[] args)
    {
    var connectionString = @"Server=tcp:" + args[0] + ",1433;Initial Catalog=" + args[1] + ";Persist Security Info=False;User ID=" + args[2] + ";Password=" + args[3] + ";MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication='Active Directory Password';";

            var upgrader = DeployChanges.To
                .SqlDatabase(connectionString)
                .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
                .LogToConsole()
                .LogScriptOutput()
                .Build();
    
            var result = upgrader.PerformUpgrade();
    
            if (!result.Successful)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(result.Error);
                Console.ResetColor();
                return -1;
            }
    
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Success!");
            Console.ResetColor();
            return 0;
        }
    }

    }
    i tried the above code, it's thrown out the sql exception for any command

    Harsh Manvar
    @harshmanvar
    Just looking forward there any docker image avilable for Db UP and or can i create own docker image ?
    Harsh Manvar
    @harsh4870
    Just looking forward there any docker image avilable for Db UP and or can i create own docker image ?
    Matthijs ter Woord
    @mterwoord
    docker image?
    Harsh Manvar
    @harshmanvar
    i am looking forward to deploy db up on kubernetes for deploying mysql scripts
    Harsh Manvar
    @harsh4870
    how to take snapshot or backup of whole database using dbup MySQl?
    kwml
    @kwml

    Does DbUp for PostgreSQL work with NodaTime? It's generating a patch script but when I try to execute it I get the following error: System.NotSupportedException: The CLR type System.DateTime isn't natively supported by Npgsql or your PostgreSQL. To use it with a PostgreSQL composite you need to specify DataTypeName or to map it, please refer to the documentation.

    I set: NpgsqlConnection.GlobalTypeMapper.UseNodaTime() before creating the upgrader as specified here: https://www.npgsql.org/doc/types/nodatime.html

    Matthew Edwards
    @_MattEdwards__twitter
    Does anyone know why when upgrading to the 4.3.0 nuget (in my case from 4.2.0) why System.Drawing and System.Windows.Forms are being added to the project? Is this because of Microsoft Azure or IdentityModel?
    Matthew Edwards
    @_MattEdwards__twitter
    NM. Answered my own question. It's MS IdentityModel.
    Natha
    @nzolotar
    I need to extend DbUp connection manager to use Azure TenantId, ClientId, ClientSecret.. to get connection to azure sql db. any thoughts?
    Marnee Dearman (KG7SIO)
    @MarneeDear
    You can pass them as parameters to your console app if you are using one