FileSqlServerSync/Server/RemoteServer/Migrations/20240708101413_InitialCreate.cs
zhaoyouya 46315ba760 chore: 添加sqlite 数据库,remote server 增加一些接口
添加了一些数据模型,添加了一些简单的单元测试
2024-10-12 21:57:45 +08:00

77 lines
3.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RemoteServer.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SyncGitCommits",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
HeadId = table.Column<Guid>(type: "TEXT", nullable: false),
CommitId = table.Column<string>(type: "TEXT", nullable: false),
CommitUserName = table.Column<string>(type: "TEXT", nullable: false),
CommitTime = table.Column<DateTime>(type: "TEXT", nullable: false),
CommitMessage = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SyncGitCommits", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SyncLogFiles",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
HeadId = table.Column<Guid>(type: "TEXT", nullable: false),
ClientRootPath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
ServerRootPath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
RelativePath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SyncLogFiles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SyncLogHeads",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
VersionsFromTag = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
SyncTime = table.Column<DateTime>(type: "TEXT", nullable: false),
ClientID = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
ClientName = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
Status = table.Column<int>(type: "INTEGER", nullable: false),
Message = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SyncLogHeads", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SyncGitCommits");
migrationBuilder.DropTable(
name: "SyncLogFiles");
migrationBuilder.DropTable(
name: "SyncLogHeads");
}
}
}