64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Apimanager_backend.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class update_api_Endpoint : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Endpoint",
|
|
table: "Apis",
|
|
type: "varchar(255)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Users",
|
|
keyColumn: "Id",
|
|
keyValue: -1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2025, 7, 30, 14, 58, 7, 232, DateTimeKind.Utc).AddTicks(4921));
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Apis_Endpoint",
|
|
table: "Apis",
|
|
column: "Endpoint",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Apis_Endpoint",
|
|
table: "Apis");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Endpoint",
|
|
table: "Apis",
|
|
type: "longtext",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(255)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "Users",
|
|
keyColumn: "Id",
|
|
keyValue: -1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2025, 7, 29, 10, 22, 34, 333, DateTimeKind.Utc).AddTicks(3700));
|
|
}
|
|
}
|
|
}
|