set your activity country
All checks were successful
Forgejo Release / release (push) Successful in 7m15s
All checks were successful
Forgejo Release / release (push) Successful in 7m15s
This commit is contained in:
parent
8b9a9103fc
commit
f992916d08
8 changed files with 5096 additions and 21 deletions
4734
src/Yavsc.Org/Migrations/20260831040104_AddPerformerCountryValidation.Designer.cs
generated
Normal file
4734
src/Yavsc.Org/Migrations/20260831040104_AddPerformerCountryValidation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,97 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPerformerCountryValidation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ExerciseCountryCode",
|
||||
table: "Performers",
|
||||
type: "character varying(2)",
|
||||
maxLength: 2,
|
||||
nullable: false,
|
||||
defaultValue: "fr");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Countries",
|
||||
columns: table => new
|
||||
{
|
||||
Code = table.Column<string>(type: "character varying(2)", maxLength: 2, nullable: false),
|
||||
DisplayName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Countries", x => x.Code);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PerformerCodeInputValidations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
CountryCode = table.Column<string>(type: "character varying(2)", maxLength: 2, nullable: false),
|
||||
RegularExpression = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||
ErrorMessage = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PerformerCodeInputValidations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PerformerCodeInputValidations_Countries_CountryCode",
|
||||
column: x => x.CountryCode,
|
||||
principalTable: "Countries",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Countries",
|
||||
columns: new[] { "Code", "DisplayName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "en", "England" },
|
||||
{ "fr", "France" },
|
||||
{ "pt", "Portugal" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "PerformerCodeInputValidations",
|
||||
columns: new[] { "Id", "CountryCode", "ErrorMessage", "RegularExpression" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1L, "fr", "Le code FR doit contenir entre 9 et 14 chiffres.", "^[0-9]{9,14}$" },
|
||||
{ 2L, "en", "Le code EN doit contenir entre 8 et 14 caracteres alphanumeriques.", "^[A-Za-z0-9]{8,14}$" },
|
||||
{ 3L, "pt", "Le code PT doit contenir exactement 9 chiffres.", "^[0-9]{9}$" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PerformerCodeInputValidations_CountryCode",
|
||||
table: "PerformerCodeInputValidations",
|
||||
column: "CountryCode");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PerformerCodeInputValidations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Countries");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExerciseCountryCode",
|
||||
table: "Performers");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1762,19 +1762,6 @@ namespace Yavsc.Migrations
|
|||
b.ToTable("Color");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Forms.Form", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Summary")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Form");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
|
|
@ -2997,6 +2984,92 @@ namespace Yavsc.Migrations
|
|||
b.ToTable("CommandForm");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.Country", b =>
|
||||
{
|
||||
b.Property<string>("Code")
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("Countries");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = "fr",
|
||||
DisplayName = "France"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = "en",
|
||||
DisplayName = "England"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = "pt",
|
||||
DisplayName = "Portugal"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("CountryCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.Property<string>("ErrorMessage")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.Property<string>("RegularExpression")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CountryCode");
|
||||
|
||||
b.ToTable("PerformerCodeInputValidations");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1L,
|
||||
CountryCode = "fr",
|
||||
ErrorMessage = "Le code FR doit contenir entre 9 et 14 chiffres.",
|
||||
RegularExpression = "^[0-9]{9,14}$"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2L,
|
||||
CountryCode = "en",
|
||||
ErrorMessage = "Le code EN doit contenir entre 8 et 14 caracteres alphanumeriques.",
|
||||
RegularExpression = "^[A-Za-z0-9]{8,14}$"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3L,
|
||||
CountryCode = "pt",
|
||||
ErrorMessage = "Le code PT doit contenir exactement 9 chiffres.",
|
||||
RegularExpression = "^[0-9]{9}$"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.Property<string>("PerformerId")
|
||||
|
|
@ -3011,6 +3084,11 @@ namespace Yavsc.Migrations
|
|||
b.Property<bool>("Active")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("ExerciseCountryCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.Property<int?>("MaxDailyCost")
|
||||
.HasColumnType("integer");
|
||||
|
||||
|
|
@ -4321,6 +4399,17 @@ namespace Yavsc.Migrations
|
|||
b.Navigation("Context");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.Country", "Country")
|
||||
.WithMany()
|
||||
.HasForeignKey("CountryCode")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Country");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Relationship.Location", "OrganizationAddress")
|
||||
|
|
|
|||
Loading…
Reference in a new issue