From a0570554dd2b7d0566a94845a8f51d04af11a08a Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Fri, 26 Mar 2021 12:26:57 +0300 Subject: [PATCH] Fixed migrations --- ...309094602_MessagesContextMySql.Designer.cs | 42 ------------------- .../20210309094602_MessagesContextMySql.cs | 33 +-------------- .../MySqlMessagesContextModelSnapshot.cs | 42 ------------------- ...100343_WebstudioDbContextMySql.Designer.cs | 32 -------------- .../20210309100343_WebstudioDbContextMySql.cs | 13 +----- .../MySqlWebstudioDbContextModelSnapshot.cs | 32 -------------- ...29101731_MessagesContextNpgsql.Designer.cs | 29 ------------- .../20200929101731_MessagesContextNpgsql.cs | 4 -- ...20200929102646_WebstudioDbContextNpgsql.cs | 11 ----- 9 files changed, 4 insertions(+), 234 deletions(-) diff --git a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.Designer.cs b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.Designer.cs index 43159f090d..75837d634d 100644 --- a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.Designer.cs +++ b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.Designer.cs @@ -247,48 +247,6 @@ namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql }); }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b => - { - b.Property("TenantId") - .HasColumnType("int") - .HasColumnName("TenantID"); - - b.Property("Id") - .HasColumnType("varchar(64)") - .HasColumnName("ID") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.Property("UserId") - .HasColumnType("varchar(64)") - .HasColumnName("UserID") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.Property("Data") - .IsRequired() - .HasColumnType("mediumtext") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.HasKey("TenantId", "Id", "UserId") - .HasName("PRIMARY"); - - b.HasIndex("Id") - .HasDatabaseName("ID"); - - b.ToTable("webstudio_settings"); - - b.HasData( - new - { - TenantId = 1, - Id = "9a925891-1f92-4ed7-b277-d6f649739f06", - UserId = "00000000-0000-0000-0000-000000000000", - Data = "{'Completed':false}" - }); - }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b => { b.Property("Id") diff --git a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.cs b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.cs index 2f9a3b5a2c..ac09ff572e 100644 --- a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.cs +++ b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210309094602_MessagesContextMySql.cs @@ -1,4 +1,5 @@ -using System; +using System; + using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; @@ -68,28 +69,6 @@ namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql table.PrimaryKey("PK_login_events", x => x.id); }); - migrationBuilder.CreateTable( - name: "webstudio_settings", - columns: table => new - { - TenantID = table.Column(type: "int", nullable: false), - ID = table.Column(type: "varchar(64)", nullable: false, collation: "utf8_general_ci") - .Annotation("MySql:CharSet", "utf8"), - UserID = table.Column(type: "varchar(64)", nullable: false, collation: "utf8_general_ci") - .Annotation("MySql:CharSet", "utf8"), - Data = table.Column(type: "mediumtext", nullable: false, collation: "utf8_general_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.TenantID, x.ID, x.UserID }); - }); - - migrationBuilder.InsertData( - table: "webstudio_settings", - columns: new[] { "ID", "TenantID", "UserID", "Data" }, - values: new object[] { "9a925891-1f92-4ed7-b277-d6f649739f06", 1, "00000000-0000-0000-0000-000000000000", "{'Completed':false}" }); - migrationBuilder.CreateIndex( name: "date", table: "audit_events", @@ -104,11 +83,6 @@ namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql name: "tenant_id", table: "login_events", columns: new[] { "tenant_id", "user_id" }); - - migrationBuilder.CreateIndex( - name: "ID", - table: "webstudio_settings", - column: "ID"); } protected override void Down(MigrationBuilder migrationBuilder) @@ -118,9 +92,6 @@ namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql migrationBuilder.DropTable( name: "login_events"); - - migrationBuilder.DropTable( - name: "webstudio_settings"); } } } diff --git a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/MySqlMessagesContextModelSnapshot.cs b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/MySqlMessagesContextModelSnapshot.cs index 3c2200b16e..a5333efcc1 100644 --- a/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/MySqlMessagesContextModelSnapshot.cs +++ b/common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/MySqlMessagesContextModelSnapshot.cs @@ -245,48 +245,6 @@ namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql }); }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b => - { - b.Property("TenantId") - .HasColumnType("int") - .HasColumnName("TenantID"); - - b.Property("Id") - .HasColumnType("varchar(64)") - .HasColumnName("ID") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.Property("UserId") - .HasColumnType("varchar(64)") - .HasColumnName("UserID") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.Property("Data") - .IsRequired() - .HasColumnType("mediumtext") - .UseCollation("utf8_general_ci") - .HasCharSet("utf8"); - - b.HasKey("TenantId", "Id", "UserId") - .HasName("PRIMARY"); - - b.HasIndex("Id") - .HasDatabaseName("ID"); - - b.ToTable("webstudio_settings"); - - b.HasData( - new - { - TenantId = 1, - Id = "9a925891-1f92-4ed7-b277-d6f649739f06", - UserId = "00000000-0000-0000-0000-000000000000", - Data = "{'Completed':false}" - }); - }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b => { b.Property("Id") diff --git a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.Designer.cs b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.Designer.cs index 26012521dd..e06f76ab1d 100644 --- a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.Designer.cs +++ b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.Designer.cs @@ -122,38 +122,6 @@ namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql .HasDatabaseName("visitdate"); b.ToTable("webstudio_uservisit"); - - b.HasData( - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 561, DateTimeKind.Utc).AddTicks(7735), - ProductId = "00000000-0000-0000-0000-000000000000", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(1507), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2187), - VisitCount = 3 - }, - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2849), - ProductId = "00000000-0000-0000-0000-000000000000", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2872), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2874), - VisitCount = 2 - }, - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2876), - ProductId = "e67be73d-f9ae-4ce1-8fec-1880cb518cb4", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2882), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2883), - VisitCount = 1 - }); }); #pragma warning restore 612, 618 } diff --git a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.cs b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.cs index a65db531a0..ca6835d02b 100644 --- a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.cs +++ b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.cs @@ -1,4 +1,5 @@ -using System; +using System; + using Microsoft.EntityFrameworkCore.Migrations; namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql @@ -61,16 +62,6 @@ namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql columns: new[] { "ID", "TenantID", "UserID", "Data" }, values: new object[] { "9a925891-1f92-4ed7-b277-d6f649739f06", 1, "00000000-0000-0000-0000-000000000000", "{'Completed':false}" }); - migrationBuilder.InsertData( - table: "webstudio_uservisit", - columns: new[] { "productid", "tenantid", "userid", "visitdate", "firstvisittime", "lastvisittime", "visitcount" }, - values: new object[,] - { - { "00000000-0000-0000-0000-000000000000", 1, "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 3, 9, 10, 3, 42, 561, DateTimeKind.Utc).AddTicks(7735), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(1507), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2187), 3 }, - { "00000000-0000-0000-0000-000000000000", 1, "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2849), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2872), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2874), 2 }, - { "e67be73d-f9ae-4ce1-8fec-1880cb518cb4", 1, "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2876), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2882), new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2883), 1 } - }); - migrationBuilder.CreateIndex( name: "ID", table: "webstudio_settings", diff --git a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/MySqlWebstudioDbContextModelSnapshot.cs b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/MySqlWebstudioDbContextModelSnapshot.cs index a3159185e9..29eb20c21a 100644 --- a/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/MySqlWebstudioDbContextModelSnapshot.cs +++ b/common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/MySqlWebstudioDbContextModelSnapshot.cs @@ -120,38 +120,6 @@ namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql .HasDatabaseName("visitdate"); b.ToTable("webstudio_uservisit"); - - b.HasData( - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 561, DateTimeKind.Utc).AddTicks(7735), - ProductId = "00000000-0000-0000-0000-000000000000", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(1507), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2187), - VisitCount = 3 - }, - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2849), - ProductId = "00000000-0000-0000-0000-000000000000", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2872), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2874), - VisitCount = 2 - }, - new - { - TenantId = 1, - VisitDate = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2876), - ProductId = "e67be73d-f9ae-4ce1-8fec-1880cb518cb4", - UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef", - FirstVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2882), - LastVisitTime = new DateTime(2021, 3, 9, 10, 3, 42, 562, DateTimeKind.Utc).AddTicks(2883), - VisitCount = 1 - }); }); #pragma warning restore 612, 618 } diff --git a/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.Designer.cs b/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.Designer.cs index 3f0478955e..39239f5e09 100644 --- a/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.Designer.cs +++ b/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.Designer.cs @@ -271,35 +271,6 @@ namespace ASC.Core.Common.Migrations.Npgsql.MessagesContextNpgsql b.ToTable("tenants_partners"); }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b => - { - b.Property("TenantId") - .HasColumnName("TenantID") - .HasColumnType("integer"); - - b.Property("Id") - .HasColumnName("ID") - .HasColumnType("uuid") - .HasMaxLength(64); - - b.Property("UserId") - .HasColumnName("UserID") - .HasColumnType("uuid") - .HasMaxLength(64); - - b.Property("Data") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("TenantId", "Id", "UserId") - .HasName("webstudio_settings_pkey"); - - b.HasIndex("Id") - .HasName("ID"); - - b.ToTable("webstudio_settings","onlyoffice"); - }); - modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b => { b.Property("Id") diff --git a/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.cs b/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.cs index 8f83fee4ad..8b3c9f689f 100644 --- a/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.cs +++ b/common/ASC.Core.Common/Migrations/Npgsql/MessagesContextNpgsql/20200929101731_MessagesContextNpgsql.cs @@ -114,10 +114,6 @@ namespace ASC.Core.Common.Migrations.Npgsql.MessagesContextNpgsql name: "login_events", schema: "onlyoffice"); - migrationBuilder.DropTable( - name: "webstudio_settings", - schema: "onlyoffice"); - migrationBuilder.DropTable( name: "tenants_tenants", schema: "onlyoffice"); diff --git a/common/ASC.Core.Common/Migrations/Npgsql/WebstudioDbContextNpgsql/20200929102646_WebstudioDbContextNpgsql.cs b/common/ASC.Core.Common/Migrations/Npgsql/WebstudioDbContextNpgsql/20200929102646_WebstudioDbContextNpgsql.cs index e6eb6b047b..d0aba44001 100644 --- a/common/ASC.Core.Common/Migrations/Npgsql/WebstudioDbContextNpgsql/20200929102646_WebstudioDbContextNpgsql.cs +++ b/common/ASC.Core.Common/Migrations/Npgsql/WebstudioDbContextNpgsql/20200929102646_WebstudioDbContextNpgsql.cs @@ -65,17 +65,6 @@ namespace ASC.Core.Common.Migrations.Npgsql.WebstudioDbContextNpgsql { 1, new Guid("9a925891-1f92-4ed7-b277-d6f649739f06"), new Guid("00000000-0000-0000-0000-000000000000"), "{\"Completed\":false}" } }); - migrationBuilder.InsertData( - schema: "onlyoffice", - table: "webstudio_uservisit", - columns: new[] { "tenantid", "visitdate", "productid", "userid", "firstvisittime", "lastvisittime", "visitcount" }, - values: new object[,] - { - { 1, new DateTime(2020, 10, 1, 16, 53, 22, 198, DateTimeKind.Utc).AddTicks(5709), new Guid("00000000-0000-0000-0000-000000000000"), new Guid("66faa6e4-f133-11ea-b126-00ffeec8b4ef"), new DateTime(2020, 10, 1, 16, 53, 22, 198, DateTimeKind.Utc).AddTicks(9735), new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(777), 3 }, - { 1, new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(1775), new Guid("00000000-0000-0000-0000-000000000000"), new Guid("66faa6e4-f133-11ea-b126-00ffeec8b4ef"), new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(2002), new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(2025), 2 }, - { 1, new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(2046), new Guid("e67be73d-f9ae-4ce1-8fec-1880cb518cb4"), new Guid("66faa6e4-f133-11ea-b126-00ffeec8b4ef"), new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(2061), new DateTime(2020, 10, 1, 16, 53, 22, 199, DateTimeKind.Utc).AddTicks(2065), 1 } - }); - migrationBuilder.CreateIndex( name: "ID", schema: "onlyoffice",