protected override void Up(MigrationBuilder migrationBuilder)
        {
            var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);

            siteEntityBuilder.AddStringColumn("Runtime", 50, true, true);
            siteEntityBuilder.UpdateColumn("Runtime", "'Server'");
            siteEntityBuilder.AddStringColumn("RenderMode", 50, true, true);
            siteEntityBuilder.UpdateColumn("RenderMode", "'ServerPrerendered'");
        }
Beispiel #2
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //Add Column to Site table
            var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);

            siteEntityBuilder.AddStringColumn("SiteGuid", 36, true, false);
        }
Beispiel #3
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //Add Column to Site table
            var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);

            siteEntityBuilder.AddStringColumn("AdminContainerType", 200, true);

            //Update new column
            siteEntityBuilder.UpdateColumn("AdminContainerType", "''");


            //Delete records from Page
            var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase);

            pageEntityBuilder.DeleteFromTable($"{ActiveDatabase.RewriteName("Path")} = 'admin/tenants'");
        }
Beispiel #4
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //Create Site table
            var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);

            siteEntityBuilder.Create();

            //Add Column to Site table (for Sql Server only) we will drop it later for Sql Server only
            if (ActiveDatabase.Name == "SqlServer")
            {
                siteEntityBuilder.AddStringColumn("DefaultLayoutType", 200, true);
            }

            //Create Page table
            var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase);

            pageEntityBuilder.Create();
            pageEntityBuilder.AddIndex("IX_Page", new [] { "SiteId", "Path", "UserId" }, true);

            //Add Columns to Page table (for Sql Server only) we will drop them later for Sql Server only
            if (ActiveDatabase.Name == "SqlServer")
            {
                pageEntityBuilder.AddBooleanColumn("EditMode");
                pageEntityBuilder.AddStringColumn("LayoutType", 200, true);
            }

            //Create Module table
            var moduleEntityBuilder = new ModuleEntityBuilder(migrationBuilder, ActiveDatabase);

            moduleEntityBuilder.Create();

            //Create PageModule table
            var pageModuleEntityBuilder = new PageModuleEntityBuilder(migrationBuilder, ActiveDatabase);

            pageModuleEntityBuilder.Create();

            //Create User table
            var userEntityBuilder = new UserEntityBuilder(migrationBuilder, ActiveDatabase);

            userEntityBuilder.Create();
            userEntityBuilder.AddIndex("IX_User", "Username", true);

            //Create Role table
            var roleEntityBuilder = new RoleEntityBuilder(migrationBuilder, ActiveDatabase);

            roleEntityBuilder.Create();

            //Create UserRole table
            var userRoleEntityBuilder = new UserRoleEntityBuilder(migrationBuilder, ActiveDatabase);

            userRoleEntityBuilder.Create();
            userRoleEntityBuilder.AddIndex("IX_UserRole", new [] { "RoleId", "UserId" }, true);

            //Create Permission table
            var permissionEntityBuilder = new PermissionEntityBuilder(migrationBuilder, ActiveDatabase);

            permissionEntityBuilder.Create();
            permissionEntityBuilder.AddIndex("IX_Permission", new [] { "SiteId", "EntityName", "EntityId", "PermissionName", "RoleId", "UserId" }, true);

            //Create Setting table
            var settingEntityBuilder = new SettingEntityBuilder(migrationBuilder, ActiveDatabase);

            settingEntityBuilder.Create();
            settingEntityBuilder.AddIndex("IX_Setting", new [] { "EntityName", "EntityId", "SettingName" }, true);

            //Create Profile table
            var profileEntityBuilder = new ProfileEntityBuilder(migrationBuilder, ActiveDatabase);

            profileEntityBuilder.Create();

            //Create Log table
            var logEntityBuilder = new LogEntityBuilder(migrationBuilder, ActiveDatabase);

            logEntityBuilder.Create();

            //Create Notification table
            var notificationEntityBuilder = new NotificationEntityBuilder(migrationBuilder, ActiveDatabase);

            notificationEntityBuilder.Create();

            //Create Folder table
            var folderEntityBuilder = new FolderEntityBuilder(migrationBuilder, ActiveDatabase);

            folderEntityBuilder.Create();
            folderEntityBuilder.AddIndex("IX_Folder", new [] { "SiteId", "Path" }, true);

            //Create File table
            var fileEntityBuilder = new FileEntityBuilder(migrationBuilder, ActiveDatabase);

            fileEntityBuilder.Create();

            //Create AspNetUsers table
            var aspNetUsersEntityBuilder = new AspNetUsersEntityBuilder(migrationBuilder, ActiveDatabase);

            aspNetUsersEntityBuilder.Create();
            aspNetUsersEntityBuilder.AddIndex("EmailIndex", "NormalizedEmail", true);
            aspNetUsersEntityBuilder.AddIndex("UserNameIndex", "NormalizedUserName", true);

            //Create AspNetUserClaims table
            var aspNetUserClaimsEntityBuilder = new AspNetUserClaimsEntityBuilder(migrationBuilder, ActiveDatabase);

            aspNetUserClaimsEntityBuilder.Create();
            aspNetUserClaimsEntityBuilder.AddIndex("IX_AspNetUserClaims_UserId", "UserId", true);
        }