Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I tried this
public override void Migrate() { Alter.Table(DatabaseConstants.QuestionTable).AddColumn(DatabaseConstants.UnpublishedColumn).AsBoolean().NotNullable().WithDefaultValue(false); }
but I get the obscure error The migration has run, but leaves an expression that has not run.
Umbraco fails to boot - i have tried replacing the value with 0 instead of false - same error.
What is the correct way of doing this in Umbraco 8?
Hello, were you able to solve this problem? I am also facing this issue. Thanks.
Hey, I fixed it. We need to add Do() at the end of the statement as below:
Do()
Alter.Table(DatabaseConstants.QuestionTable).AddColumn(DatabaseConstants.UnpublishedColumn).AsBoolean().NotNullable().WithDefaultValue(false).Do();
Thanks.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to add a migration that adds a boolean column to an existing table, is not null and has a default value of false?
I tried this
but I get the obscure error The migration has run, but leaves an expression that has not run.
Umbraco fails to boot - i have tried replacing the value with 0 instead of false - same error.
What is the correct way of doing this in Umbraco 8?
Hello, were you able to solve this problem? I am also facing this issue. Thanks.
Hey, I fixed it. We need to add
Do()
at the end of the statement as below:Alter.Table(DatabaseConstants.QuestionTable).AddColumn(DatabaseConstants.UnpublishedColumn).AsBoolean().NotNullable().WithDefaultValue(false).Do();
Thanks.
is working on a reply...