158 lines
5.0 KiB
C#
158 lines
5.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace line_gestao_api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddMuregMobileLineRelations : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MuregLines_Cliente",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Cliente",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LinhaNova",
|
|
table: "MuregLines",
|
|
type: "character varying(30)",
|
|
maxLength: 30,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LinhaAntiga",
|
|
table: "MuregLines",
|
|
type: "character varying(30)",
|
|
maxLength: 30,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "ICCID",
|
|
table: "MuregLines",
|
|
type: "character varying(40)",
|
|
maxLength: 40,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "MobileLineId",
|
|
table: "MuregLines",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MuregLines_LinhaAntiga",
|
|
table: "MuregLines",
|
|
column: "LinhaAntiga");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MuregLines_MobileLineId",
|
|
table: "MuregLines",
|
|
column: "MobileLineId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MobileLines_Chip",
|
|
table: "MobileLines",
|
|
column: "Chip");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MobileLines_Cliente",
|
|
table: "MobileLines",
|
|
column: "Cliente");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_MuregLines_MobileLines_MobileLineId",
|
|
table: "MuregLines",
|
|
column: "MobileLineId",
|
|
principalTable: "MobileLines",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_MuregLines_MobileLines_MobileLineId",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MuregLines_LinhaAntiga",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MuregLines_MobileLineId",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MobileLines_Chip",
|
|
table: "MobileLines");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MobileLines_Cliente",
|
|
table: "MobileLines");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MobileLineId",
|
|
table: "MuregLines");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LinhaNova",
|
|
table: "MuregLines",
|
|
type: "text",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "character varying(30)",
|
|
oldMaxLength: 30,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LinhaAntiga",
|
|
table: "MuregLines",
|
|
type: "text",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "character varying(30)",
|
|
oldMaxLength: 30,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "ICCID",
|
|
table: "MuregLines",
|
|
type: "text",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "character varying(40)",
|
|
oldMaxLength: 40,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Cliente",
|
|
table: "MuregLines",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MuregLines_Cliente",
|
|
table: "MuregLines",
|
|
column: "Cliente");
|
|
}
|
|
}
|
|
}
|