thanks for the reply, but I'm not sure if I need editions. This is what I try to setup:
I only need one tenant now, this is the main portal site. Here users can register. The portal is a video-on-demand, livestream site. much like livebasketball.tv, but for a domestic league. So the users should be able to subscribe to a plan (both one time and recurrent payments) and be able to view on-demand content and livestreams. I will be using Braintree as payment processor. Easy integration here.
So I'm thinking of building a new feature "subscriptions", adding this to the backend interface for administration purposes. On the frontend the only thing needed is a way to attach the SubscriptionId and payment info to a user.
I have allready started building the feature, using the new "chat feature" as reference, so I hope I'm on the right track here?
Yeah, just noticed this, the tables are gone now. Logging into the backend app throws an error for the chat app.
Should I run the Update-Database again?
It generated:
public partial class Upgrade_To_AspNetZero_111 : DbMigration
{
public override void Up()
{
DropTable("dbo.AppChatMessages",
removedAnnotations: new Dictionary<string, object>
{
{ "DynamicFilter_ChatMessage_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
});
DropTable("dbo.AppFriendships",
removedAnnotations: new Dictionary<string, object>
{
{ "DynamicFilter_Friendship_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
});
}
public override void Down()
{
CreateTable(
"dbo.AppFriendships",
c => new
{
Id = c.Long(nullable: false, identity: true),
UserId = c.Long(nullable: false),
TenantId = c.Int(),
FriendUserId = c.Long(nullable: false),
FriendTenantId = c.Int(),
FriendUserName = c.String(nullable: false, maxLength: 32),
FriendTenancyName = c.String(),
FriendProfilePictureId = c.Guid(),
State = c.Int(nullable: false),
CreationTime = c.DateTime(nullable: false),
},
annotations: new Dictionary<string, object>
{
{ "DynamicFilter_Friendship_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.AppChatMessages",
c => new
{
Id = c.Long(nullable: false, identity: true),
UserId = c.Long(nullable: false),
TenantId = c.Int(),
TargetUserId = c.Long(nullable: false),
TargetTenantId = c.Int(),
Message = c.String(nullable: false),
CreationTime = c.DateTime(nullable: false),
Side = c.Int(nullable: false),
ReadState = c.Int(nullable: false),
},
annotations: new Dictionary<string, object>
{
{ "DynamicFilter_ChatMessage_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
})
.PrimaryKey(t => t.Id);
}
}
}
After that I ran the command "Update-Database" and reloaded the site. Bingo, no more error.
So in the future, I don't need the migration files you guys added?
If I do Add-Migration it asks for "Name"? Is this like "201606150821191_Added_Chat_And_Friendship_Entities"? And what does it do exactly?
I copied the new Chat and Friendship classes from the latest build source.
I always used Database First in the past, so this is new stuff for me.
Under \EntityFramework\Migrations\Configuration, AutomaticMigrationsEnabled is set to False. Would setting this to True help?
oops, my mistake, the code was missing indeed. It's working now, the Angular Grids are also working.
Now I want to upgrade the database. I'm using the Packet Manager Console and the command Upgrade-Database. This is the result:
Applying explicit migrations: [201606150821191_Added_Chat_And_Friendship_Entities, 201606161233356_Make_FriendShip_And_Chat_TenantId_Nullable, 201606220958138_Add_FriendUserName_To_Friendship_Table, 201606231022491_Add_TenancyName_And_ProfilePictureId_To_AppFriendships_Table, 201606240745029_Add_MayHaveTenant_Annotation_To_ChatMessage_And_Friendship, 201607211123175_Added_Validation_To_Chat_Entities].
Applying explicit migration: 201606150821191_Added_Chat_And_Friendship_Entities.
Applying explicit migration: 201606161233356_Make_FriendShip_And_Chat_TenantId_Nullable.
Applying explicit migration: 201606220958138_Add_FriendUserName_To_Friendship_Table.
Applying explicit migration: 201606231022491_Add_TenancyName_And_ProfilePictureId_To_AppFriendships_Table.
Applying explicit migration: 201606240745029_Add_MayHaveTenant_Annotation_To_ChatMessage_And_Friendship.
Applying explicit migration: 201607211123175_Added_Validation_To_Chat_Entities.
Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration.
You can use the Add-Migration command to write the pending model changes to a code-based migration.
If I look at the database the tables are created correctly. But I'm confused with the last statement "Unable to update database to match the current model". What does this mean, what do I need to do?
And now getting this error:
The model backing the 'TIBtvDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
I understand that it's not as straightforward as I first thougth, and merging all your changes in my project manually is actually a good thing, because I learn the structure of aspnetzero.
However, some problems, still persist, even after copying all changed code or layout files.
Most pressing issue now is why AbpSession is throwing an error? This is part of the Abp dll's, which I allready updated. Any help would be welcome.
Now I'm also getting this when opening the backend app:
The name 'AbpSession' does not exist in the current context
@if (AbpSession.MultiTenancySide == MultiTenancySides.Host || IsFeatureEnabled(AppFeatures.ChatFeature))
Line 76: {
Line 77: <div data-ng-include="'~/App/common/views/layout/chatbar.cshtml'" data-ng-controller="common.views.layout.chatbar as vm">
Source File: ...\App\common\views\layout\layout.cshtml Line: 75
At this moment I'm trying to implement all the changes from the latest version, this could maybe solve the issue.
But can you tell me how to upgrade the database with the new tables,... as described in "201606150821191_Added_Chat_And_Friendship_Entities" and the rest?