From 94c7c7ac1b85a5845eb1bac949cf645379d5413c Mon Sep 17 00:00:00 2001 From: Jeff Leung Date: Fri, 31 Dec 2021 00:12:38 -0800 Subject: [PATCH] Dump migrations --- ...211231074942_InitialMigration.Designer.cs} | 39 ++++++++++++------- ....cs => 20211231074942_InitialMigration.cs} | 30 +++++++------- .../Migrations/SMSDbCtxModelSnapshot.cs | 35 +++++++++++------ .../TwilioSMSReceiver.Data.csproj | 5 +++ .../TwilioSMSReceiver.Web.csproj | 5 +++ 5 files changed, 73 insertions(+), 41 deletions(-) rename TwilioSMSReceiver.Data/Migrations/{20211229034231_InitialMigrationSQLite.Designer.cs => 20211231074942_InitialMigration.Designer.cs} (67%) rename TwilioSMSReceiver.Data/Migrations/{20211229034231_InitialMigrationSQLite.cs => 20211231074942_InitialMigration.cs} (69%) diff --git a/TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.Designer.cs b/TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.Designer.cs similarity index 67% rename from TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.Designer.cs rename to TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.Designer.cs index 53c2a31..2837705 100644 --- a/TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.Designer.cs +++ b/TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.Designer.cs @@ -2,6 +2,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using TwilioSMSReceiver.Data; @@ -11,25 +12,31 @@ using TwilioSMSReceiver.Data; namespace TwilioSMSReceiver.Data.Migrations { [DbContext(typeof(SMSDbCtx))] - [Migration("20211229034231_InitialMigrationSQLite")] - partial class InitialMigrationSQLite + [Migration("20211231074942_InitialMigration")] + partial class InitialMigration { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); modelBuilder.Entity("TwilioSMSReceiver.Data.Models.MMSModel", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("OriginalMMSData") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("SMSModelId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -42,10 +49,12 @@ namespace TwilioSMSReceiver.Data.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("WebHookUri") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); @@ -56,24 +65,26 @@ namespace TwilioSMSReceiver.Data.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("IsForwardedYet") - .HasColumnType("INTEGER"); + .HasColumnType("bit"); b.Property("MessageContents") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("ReceivedNumber") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("SenderNumber") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("TimeReceived") - .HasColumnType("TEXT"); + .HasColumnType("datetime2"); b.HasKey("Id"); diff --git a/TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.cs b/TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.cs similarity index 69% rename from TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.cs rename to TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.cs index 20b11df..2a16272 100644 --- a/TwilioSMSReceiver.Data/Migrations/20211229034231_InitialMigrationSQLite.cs +++ b/TwilioSMSReceiver.Data/Migrations/20211231074942_InitialMigration.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace TwilioSMSReceiver.Data.Migrations { - public partial class InitialMigrationSQLite : Migration + public partial class InitialMigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -13,9 +13,9 @@ namespace TwilioSMSReceiver.Data.Migrations name: "MSTeamsWebHooks", columns: table => new { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - WebHookUri = table.Column(type: "TEXT", nullable: true) + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + WebHookUri = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { @@ -26,13 +26,13 @@ namespace TwilioSMSReceiver.Data.Migrations name: "SMSMessages", columns: table => new { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - ReceivedNumber = table.Column(type: "TEXT", nullable: false), - SenderNumber = table.Column(type: "TEXT", nullable: false), - TimeReceived = table.Column(type: "TEXT", nullable: false), - MessageContents = table.Column(type: "TEXT", nullable: true), - IsForwardedYet = table.Column(type: "INTEGER", nullable: false) + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ReceivedNumber = table.Column(type: "nvarchar(max)", nullable: false), + SenderNumber = table.Column(type: "nvarchar(max)", nullable: false), + TimeReceived = table.Column(type: "datetime2", nullable: false), + MessageContents = table.Column(type: "nvarchar(max)", nullable: true), + IsForwardedYet = table.Column(type: "bit", nullable: false) }, constraints: table => { @@ -43,10 +43,10 @@ namespace TwilioSMSReceiver.Data.Migrations name: "MMSMessages", columns: table => new { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - SMSModelId = table.Column(type: "INTEGER", nullable: false), - OriginalMMSData = table.Column(type: "TEXT", nullable: true) + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + SMSModelId = table.Column(type: "int", nullable: false), + OriginalMMSData = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { diff --git a/TwilioSMSReceiver.Data/Migrations/SMSDbCtxModelSnapshot.cs b/TwilioSMSReceiver.Data/Migrations/SMSDbCtxModelSnapshot.cs index 7017746..7359294 100644 --- a/TwilioSMSReceiver.Data/Migrations/SMSDbCtxModelSnapshot.cs +++ b/TwilioSMSReceiver.Data/Migrations/SMSDbCtxModelSnapshot.cs @@ -2,6 +2,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using TwilioSMSReceiver.Data; @@ -15,19 +16,25 @@ namespace TwilioSMSReceiver.Data.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); modelBuilder.Entity("TwilioSMSReceiver.Data.Models.MMSModel", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("OriginalMMSData") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("SMSModelId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -40,10 +47,12 @@ namespace TwilioSMSReceiver.Data.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("WebHookUri") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); @@ -54,24 +63,26 @@ namespace TwilioSMSReceiver.Data.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); b.Property("IsForwardedYet") - .HasColumnType("INTEGER"); + .HasColumnType("bit"); b.Property("MessageContents") - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("ReceivedNumber") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("SenderNumber") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("nvarchar(max)"); b.Property("TimeReceived") - .HasColumnType("TEXT"); + .HasColumnType("datetime2"); b.HasKey("Id"); diff --git a/TwilioSMSReceiver.Data/TwilioSMSReceiver.Data.csproj b/TwilioSMSReceiver.Data/TwilioSMSReceiver.Data.csproj index cddbcf0..85022c5 100644 --- a/TwilioSMSReceiver.Data/TwilioSMSReceiver.Data.csproj +++ b/TwilioSMSReceiver.Data/TwilioSMSReceiver.Data.csproj @@ -8,6 +8,11 @@ + + + + + diff --git a/TwilioSMSReceiver.Web/TwilioSMSReceiver.Web.csproj b/TwilioSMSReceiver.Web/TwilioSMSReceiver.Web.csproj index 9669239..f584509 100644 --- a/TwilioSMSReceiver.Web/TwilioSMSReceiver.Web.csproj +++ b/TwilioSMSReceiver.Web/TwilioSMSReceiver.Web.csproj @@ -15,4 +15,9 @@ + + + + +