Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lena 2 posts 72 karma points
    Apr 22, 2021 @ 18:12
    Lena
    0

    Custom Database Migration 'Create.Table' Error

    I am using Umbraco 8, v.8.11.1, and am trying to extend the Umbraco database with my own table. I have followed this guide here in the documentation:

    https://our.umbraco.com/documentation/extending/database/

    On this code line, inside the Migrate method, it breaks:

    Create.Table<BlogCommentSchema>().Do();
    

    Here is the error message:

    Create = 'Create' threw an exception of type 'Umbraco.Core.Migrations.IncompleteMigrationExpressionException'    
    Umbraco.Core.Migrations.IncompleteMigrationExpressionException: 'Cannot create a new expression: the previous expression has not run.'
    

    In the documentation for this error, found here:

    https://our.umbraco.com/apidocs/v8/csharp/api/Umbraco.Core.Migrations.IncompleteMigrationExpressionException.html

    it says:

    "Remarks

    Migration expressions such as Alter.Table(...).Do() must end with Do(), else they are not executed. When a non-executed expression is detected, an IncompleteMigrationExpressionException is thrown."

    I assume this has something to do with it, but it makes no sense since the code ends with a Do();

    Create.Table<BlogCommentSchema>().Do();
    

    I have also tried some adjustments to the code, mainly following this guide, with no change:

    https://our.umbraco.com/forum/umbraco-8/98439-create-custom-database-table-in-umbraco-8

    I have tried exchanging the database sdf file in App_Data to the initial "clean" Umbraco database sdf which I had a backup of, but this made no difference either.

    As I understand it there is no need to install any packages to be able to use Migrations.

  • Lena 2 posts 72 karma points
    Apr 23, 2021 @ 13:54
    Lena
    0

    Solution: I had to upgrade to Umbraco version 8.13.0

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies