2024-07-04 11:02:45 +05:00
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
2023-10-09 12:20:00 +05:00
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Migrations
|
|
|
|
{
|
|
|
|
public partial class Add_Contacts : Migration
|
|
|
|
{
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "t_contact",
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
2023-10-12 16:33:30 +05:00
|
|
|
id_company_type = table.Column<int>(type: "integer", maxLength: 255, nullable: false, comment: "вид деятельности"),
|
2023-10-09 12:20:00 +05:00
|
|
|
fio = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "ФИО"),
|
|
|
|
email = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "email"),
|
2023-10-12 16:33:30 +05:00
|
|
|
phone = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "номер телефона"),
|
|
|
|
position = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "должность"),
|
|
|
|
company = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "компания")
|
2023-10-09 12:20:00 +05:00
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_t_contact", x => x.id);
|
|
|
|
table.ForeignKey(
|
2023-10-12 16:33:30 +05:00
|
|
|
name: "FK_t_contact_t_company_type_id_company_type",
|
|
|
|
column: x => x.id_company_type,
|
|
|
|
principalTable: "t_company_type",
|
2023-10-09 12:20:00 +05:00
|
|
|
principalColumn: "id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
},
|
|
|
|
comment: "Контакты");
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2023-10-12 16:33:30 +05:00
|
|
|
name: "IX_t_contact_id_company_type",
|
2023-10-09 12:20:00 +05:00
|
|
|
table: "t_contact",
|
2023-10-12 16:33:30 +05:00
|
|
|
column: "id_company_type");
|
2023-10-09 12:20:00 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "t_contact");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|