forked from MDCPS/DamageAssessment_Backend
		
	Added sql docker logic
This commit is contained in:
		| @ -1,95 +0,0 @@ | ||||
| // <auto-generated /> | ||||
| using System; | ||||
| using DamageAssesment.Api.DocuLinks.Db; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Metadata; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace DamageAssesment.Api.DocuLinks.Migrations | ||||
| { | ||||
|     [DbContext(typeof(DoculinkDbContext))] | ||||
|     [Migration("20230828165655_InitialDocumentCreate")] | ||||
|     partial class InitialDocumentCreate | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void BuildTargetModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
| #pragma warning disable 612, 618 | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "7.0.9") | ||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 128); | ||||
|  | ||||
|             SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); | ||||
|  | ||||
|             modelBuilder.Entity("DamageAssesment.Api.DocuLinks.Db.Document", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); | ||||
|  | ||||
|                     b.Property<bool>("IsActive") | ||||
|                         .HasColumnType("bit"); | ||||
|  | ||||
|                     b.Property<string>("Path") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<DateTime>("dateCreated") | ||||
|                         .HasColumnType("datetime2"); | ||||
|  | ||||
|                     b.Property<DateTime>("dateUpdated") | ||||
|                         .HasColumnType("datetime2"); | ||||
|  | ||||
|                     b.Property<string>("description") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<string>("docName") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<int>("linkTypeId") | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     b.Property<string>("title") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<string>("url") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("Documents"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("DamageAssesment.Api.DocuLinks.Db.LinkType", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); | ||||
|  | ||||
|                     b.Property<bool>("IsActive") | ||||
|                         .HasColumnType("bit"); | ||||
|  | ||||
|                     b.Property<string>("TypeText") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("LinkTypes"); | ||||
|                 }); | ||||
| #pragma warning restore 612, 618 | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1,60 +0,0 @@ | ||||
| using System; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace DamageAssesment.Api.DocuLinks.Migrations | ||||
| { | ||||
|     /// <inheritdoc /> | ||||
|     public partial class InitialDocumentCreate : Migration | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "Documents", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(type: "int", nullable: false) | ||||
|                         .Annotation("SqlServer:Identity", "1, 1"), | ||||
|                     title = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     linkTypeId = table.Column<int>(type: "int", nullable: false), | ||||
|                     description = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     docName = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     url = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     Path = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     IsActive = table.Column<bool>(type: "bit", nullable: false), | ||||
|                     dateCreated = table.Column<DateTime>(type: "datetime2", nullable: false), | ||||
|                     dateUpdated = table.Column<DateTime>(type: "datetime2", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_Documents", x => x.Id); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "LinkTypes", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(type: "int", nullable: false) | ||||
|                         .Annotation("SqlServer:Identity", "1, 1"), | ||||
|                     TypeText = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     IsActive = table.Column<bool>(type: "bit", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_LinkTypes", x => x.Id); | ||||
|                 }); | ||||
|         } | ||||
|  | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "Documents"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "LinkTypes"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1,118 +0,0 @@ | ||||
| // <auto-generated /> | ||||
| using System; | ||||
| using DamageAssesment.Api.DocuLinks.Db; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Metadata; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace DamageAssesment.Api.DocuLinks.Migrations | ||||
| { | ||||
|     [DbContext(typeof(DoculinkDbContext))] | ||||
|     [Migration("20230830200432_DocumentTranslation")] | ||||
|     partial class DocumentTranslation | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void BuildTargetModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
| #pragma warning disable 612, 618 | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "7.0.9") | ||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 128); | ||||
|  | ||||
|             SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); | ||||
|  | ||||
|             modelBuilder.Entity("DamageAssesment.Api.DocuLinks.Db.Document", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); | ||||
|  | ||||
|                     b.Property<bool>("IsActive") | ||||
|                         .HasColumnType("bit"); | ||||
|  | ||||
|                     b.Property<string>("Path") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<DateTime>("dateCreated") | ||||
|                         .HasColumnType("datetime2"); | ||||
|  | ||||
|                     b.Property<DateTime>("dateUpdated") | ||||
|                         .HasColumnType("datetime2"); | ||||
|  | ||||
|                     b.Property<string>("docName") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<int>("linkTypeId") | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     b.Property<string>("url") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("Documents"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("DamageAssesment.Api.DocuLinks.Db.DocumentsTranslation", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); | ||||
|  | ||||
|                     b.Property<int>("DocumentId") | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     b.Property<string>("Language") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<string>("description") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.Property<string>("title") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("DocumentsTranslations"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("DamageAssesment.Api.DocuLinks.Db.LinkType", b => | ||||
|                 { | ||||
|                     b.Property<int>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("int"); | ||||
|  | ||||
|                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); | ||||
|  | ||||
|                     b.Property<bool>("IsActive") | ||||
|                         .HasColumnType("bit"); | ||||
|  | ||||
|                     b.Property<bool>("IsAttachment") | ||||
|                         .HasColumnType("bit"); | ||||
|  | ||||
|                     b.Property<string>("TypeText") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("nvarchar(max)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("LinkTypes"); | ||||
|                 }); | ||||
| #pragma warning restore 612, 618 | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1,70 +0,0 @@ | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace DamageAssesment.Api.DocuLinks.Migrations | ||||
| { | ||||
|     /// <inheritdoc /> | ||||
|     public partial class DocumentTranslation : Migration | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "description", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "title", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.AddColumn<bool>( | ||||
|                 name: "IsAttachment", | ||||
|                 table: "LinkTypes", | ||||
|                 type: "bit", | ||||
|                 nullable: false, | ||||
|                 defaultValue: false); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "DocumentsTranslations", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(type: "int", nullable: false) | ||||
|                         .Annotation("SqlServer:Identity", "1, 1"), | ||||
|                     DocumentId = table.Column<int>(type: "int", nullable: false), | ||||
|                     title = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     description = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     Language = table.Column<string>(type: "nvarchar(max)", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_DocumentsTranslations", x => x.Id); | ||||
|                 }); | ||||
|         } | ||||
|  | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "DocumentsTranslations"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "IsAttachment", | ||||
|                 table: "LinkTypes"); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "description", | ||||
|                 table: "Documents", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "title", | ||||
|                 table: "Documents", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1,144 +0,0 @@ | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace DamageAssesment.Api.DocuLinks.Migrations | ||||
| { | ||||
|     /// <inheritdoc /> | ||||
|     public partial class doculinkUpdate : Migration | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "IsAttachment", | ||||
|                 table: "LinkTypes"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "TypeText", | ||||
|                 table: "LinkTypes"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "Path", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "docName", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "url", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.AddColumn<int>( | ||||
|                 name: "CustomOrder", | ||||
|                 table: "LinkTypes", | ||||
|                 type: "int", | ||||
|                 nullable: false, | ||||
|                 defaultValue: 0); | ||||
|  | ||||
|             migrationBuilder.AddColumn<int>( | ||||
|                 name: "CustomOrder", | ||||
|                 table: "Documents", | ||||
|                 type: "int", | ||||
|                 nullable: false, | ||||
|                 defaultValue: 0); | ||||
|  | ||||
|             migrationBuilder.AddColumn<bool>( | ||||
|                 name: "IsDeleted", | ||||
|                 table: "Documents", | ||||
|                 type: "bit", | ||||
|                 nullable: false, | ||||
|                 defaultValue: false); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "DoclinksAttachments", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(type: "int", nullable: false) | ||||
|                         .Annotation("SqlServer:Identity", "1, 1"), | ||||
|                     DocumentId = table.Column<int>(type: "int", nullable: false), | ||||
|                     docName = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     Path = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     IsAttachments = table.Column<bool>(type: "bit", nullable: false), | ||||
|                     CustomOrder = table.Column<int>(type: "int", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_DoclinksAttachments", x => x.Id); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "LinksTranslations", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<int>(type: "int", nullable: false) | ||||
|                         .Annotation("SqlServer:Identity", "1, 1"), | ||||
|                     LinkTypeId = table.Column<int>(type: "int", nullable: false), | ||||
|                     TypeText = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||||
|                     Language = table.Column<string>(type: "nvarchar(max)", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_LinksTranslations", x => x.Id); | ||||
|                 }); | ||||
|         } | ||||
|  | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "DoclinksAttachments"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "LinksTranslations"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "CustomOrder", | ||||
|                 table: "LinkTypes"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "CustomOrder", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.DropColumn( | ||||
|                 name: "IsDeleted", | ||||
|                 table: "Documents"); | ||||
|  | ||||
|             migrationBuilder.AddColumn<bool>( | ||||
|                 name: "IsAttachment", | ||||
|                 table: "LinkTypes", | ||||
|                 type: "bit", | ||||
|                 nullable: false, | ||||
|                 defaultValue: false); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "TypeText", | ||||
|                 table: "LinkTypes", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "Path", | ||||
|                 table: "Documents", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "docName", | ||||
|                 table: "Documents", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|  | ||||
|             migrationBuilder.AddColumn<string>( | ||||
|                 name: "url", | ||||
|                 table: "Documents", | ||||
|                 type: "nvarchar(max)", | ||||
|                 nullable: false, | ||||
|                 defaultValue: ""); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user