20260104154100_AddMapFileUrlAndOffsetFields.cs
1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Rcs.Infrastructure.Migrations
{
/// <summary>
/// 添加地图URL字段到maps表,添加偏移量字段到map_files表
/// @author zzy
/// </summary>
public partial class AddMapFileUrlAndOffsetFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// 添加URL字段到maps表
migrationBuilder.AddColumn<string>(
name: "resource_url",
table: "maps",
type: "character varying(512)",
maxLength: 512,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "points_url",
table: "maps",
type: "character varying(512)",
maxLength: 512,
nullable: true);
// 添加偏移量字段到map_files表
migrationBuilder.AddColumn<decimal>(
name: "offset_x",
table: "map_files",
type: "numeric(10,2)",
nullable: false,
defaultValue: 0.00m);
migrationBuilder.AddColumn<decimal>(
name: "offset_y",
table: "map_files",
type: "numeric(10,2)",
nullable: false,
defaultValue: 0.00m);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "resource_url",
table: "maps");
migrationBuilder.DropColumn(
name: "points_url",
table: "maps");
migrationBuilder.DropColumn(
name: "offset_x",
table: "map_files");
migrationBuilder.DropColumn(
name: "offset_y",
table: "map_files");
}
}
}