2fb86a435e
ASP.NET Core 10 Razor Pages + PostgreSQL/EF Core. RTL Persian, Jalali dates, self-hosted Vazirmatn, teal/coral brand. Features: - Shift listings: browse/filter (city, district, role, type, pay), weekly Jalali calendar, detail + interest handoff, near-me distance sort - Hiring (استخدام) listings with employment type + salary range - Pattern-engine recommendations + anonymous interest tracking (visitor cookie) - Heuristic Persian listing-parser + admin queue (raw channel post → shift/job) - Phone-OTP cookie auth + visitor-history linking + profile Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
80 lines
2.8 KiB
C#
80 lines
2.8 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace JobsMedical.Web.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddDistricts : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "DistrictId",
|
|
table: "Facilities",
|
|
type: "integer",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Districts",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
CityId = table.Column<int>(type: "integer", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
|
|
IsActive = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Districts", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Districts_Cities_CityId",
|
|
column: x => x.CityId,
|
|
principalTable: "Cities",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Facilities_DistrictId",
|
|
table: "Facilities",
|
|
column: "DistrictId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Districts_CityId",
|
|
table: "Districts",
|
|
column: "CityId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Facilities_Districts_DistrictId",
|
|
table: "Facilities",
|
|
column: "DistrictId",
|
|
principalTable: "Districts",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Facilities_Districts_DistrictId",
|
|
table: "Facilities");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Districts");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Facilities_DistrictId",
|
|
table: "Facilities");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "DistrictId",
|
|
table: "Facilities");
|
|
}
|
|
}
|
|
}
|