Merge branch 'video/55_Ejecucion_De_Migracion' into dev
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.2">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using CleanArchitecture.Application.Contracts.Infrastructure;
|
using CleanArchitecture.Application.Contracts.Infrastructure;
|
||||||
using CleanArchitecture.Application.Contracts.Persistence;
|
using CleanArchitecture.Application.Contracts.Persistence;
|
||||||
using CleanArchitecture.Application.Models;
|
using CleanArchitecture.Application.Models;
|
||||||
|
using CleanArchitecture.Infrastructure.Email;
|
||||||
using CleanArchitecture.Infrastructure.Persistence;
|
using CleanArchitecture.Infrastructure.Persistence;
|
||||||
using CleanArchitecture.Infrastructure.Repositories;
|
using CleanArchitecture.Infrastructure.Repositories;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -26,7 +27,7 @@ namespace CleanArchitecture.Infrastructure
|
|||||||
services.AddScoped<IStreamerRepository, StreamerRepository>();
|
services.AddScoped<IStreamerRepository, StreamerRepository>();
|
||||||
|
|
||||||
services.Configure<EmailSettings>(c =>configuration.GetSection("EmailSettings"));
|
services.Configure<EmailSettings>(c =>configuration.GetSection("EmailSettings"));
|
||||||
services.AddTransient<IEmailService, IEmailService>();
|
services.AddTransient<IEmailService, EmailService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
230
CleanArchitecture/CleanArchitecture.Data/Migrations/20240218123327_cleanArchitectureFromApi.Designer.cs
generated
Normal file
230
CleanArchitecture/CleanArchitecture.Data/Migrations/20240218123327_cleanArchitectureFromApi.Designer.cs
generated
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using CleanArchitecture.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CleanArchitecture.Data.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(StreamerDbContext))]
|
||||||
|
[Migration("20240218123327_cleanArchitectureFromApi")]
|
||||||
|
partial class cleanArchitectureFromApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.2")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Actor", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Apellido")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Nombre")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Actor");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Director", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Apellido")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Nombre")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("VideoId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Director");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Streamer", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Nombre")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Url")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Streamers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Video", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int?>("DirectorId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Nombre")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("StreamerId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DirectorId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("StreamerId");
|
||||||
|
|
||||||
|
b.ToTable("Videos");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.VideoActor", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("VideoId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ActorId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.HasKey("VideoId", "ActorId");
|
||||||
|
|
||||||
|
b.HasIndex("ActorId");
|
||||||
|
|
||||||
|
b.ToTable("VideoActor");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Video", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("CleanArchitecture.Domain.Director", "Director")
|
||||||
|
.WithOne("Video")
|
||||||
|
.HasForeignKey("CleanArchitecture.Domain.Video", "DirectorId");
|
||||||
|
|
||||||
|
b.HasOne("CleanArchitecture.Domain.Streamer", "Streamer")
|
||||||
|
.WithMany("Videos")
|
||||||
|
.HasForeignKey("StreamerId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Director");
|
||||||
|
|
||||||
|
b.Navigation("Streamer");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.VideoActor", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("CleanArchitecture.Domain.Actor", "Actor")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ActorId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("CleanArchitecture.Domain.Video", "Video")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("VideoId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Actor");
|
||||||
|
|
||||||
|
b.Navigation("Video");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Director", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Video");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CleanArchitecture.Domain.Streamer", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Videos");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CleanArchitecture.Data.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class cleanArchitectureFromApi : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CreatedBy",
|
||||||
|
table: "VideoActor",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "CreatedDate",
|
||||||
|
table: "VideoActor",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Id",
|
||||||
|
table: "VideoActor",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "LastModifiedBy",
|
||||||
|
table: "VideoActor",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "LastModifiedDate",
|
||||||
|
table: "VideoActor",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CreatedBy",
|
||||||
|
table: "VideoActor");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CreatedDate",
|
||||||
|
table: "VideoActor");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Id",
|
||||||
|
table: "VideoActor");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "LastModifiedBy",
|
||||||
|
table: "VideoActor");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "LastModifiedDate",
|
||||||
|
table: "VideoActor");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -154,6 +154,21 @@ namespace CleanArchitecture.Data.Migrations
|
|||||||
b.Property<int>("ActorId")
|
b.Property<int>("ActorId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CreatedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("LastModifiedBy")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModifiedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.HasKey("VideoId", "ActorId");
|
b.HasKey("VideoId", "ActorId");
|
||||||
|
|
||||||
b.HasIndex("ActorId");
|
b.HasIndex("ActorId");
|
||||||
|
|||||||
Reference in New Issue
Block a user