tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20241103161856_MYAddAutoStartAndStop.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
8 public partial class MYAddAutoStartAndStop : Migration
9 {
11 protected override void Up(MigrationBuilder migrationBuilder)
12 {
13 ArgumentNullException.ThrowIfNull(migrationBuilder);
14
15 migrationBuilder.AlterColumn<long>(
16 name: "UserId",
17 table: "OAuthConnections",
18 type: "bigint",
19 nullable: false,
20 defaultValue: 0L,
21 oldClrType: typeof(long),
22 oldType: "bigint",
23 oldNullable: true);
24
25 migrationBuilder.AlterColumn<string>(
26 name: "AutoUpdateCron",
27 table: "Instances",
28 type: "varchar(1000)",
29 maxLength: 1000,
30 nullable: false,
31 oldClrType: typeof(string),
32 oldType: "varchar(10000)",
33 oldMaxLength: 10000)
34 .Annotation("MySql:CharSet", "utf8mb4")
35 .OldAnnotation("MySql:CharSet", "utf8mb4");
36
37 migrationBuilder.AddColumn<string>(
38 name: "AutoStartCron",
39 table: "Instances",
40 type: "varchar(1000)",
41 maxLength: 1000,
42 nullable: false,
43 defaultValue: String.Empty)
44 .Annotation("MySql:CharSet", "utf8mb4");
45
46 migrationBuilder.AddColumn<string>(
47 name: "AutoStopCron",
48 table: "Instances",
49 type: "varchar(1000)",
50 maxLength: 1000,
51 nullable: false,
52 defaultValue: String.Empty)
53 .Annotation("MySql:CharSet", "utf8mb4");
54 }
55
57 protected override void Down(MigrationBuilder migrationBuilder)
58 {
59 ArgumentNullException.ThrowIfNull(migrationBuilder);
60
61 migrationBuilder.DropColumn(
62 name: "AutoStartCron",
63 table: "Instances");
64
65 migrationBuilder.DropColumn(
66 name: "AutoStopCron",
67 table: "Instances");
68
69 migrationBuilder.AlterColumn<long>(
70 name: "UserId",
71 table: "OAuthConnections",
72 type: "bigint",
73 nullable: true,
74 oldClrType: typeof(long),
75 oldType: "bigint");
76
77 migrationBuilder.AlterColumn<string>(
78 name: "AutoUpdateCron",
79 table: "Instances",
80 type: "varchar(10000)",
81 maxLength: 10000,
82 nullable: false,
83 oldClrType: typeof(string),
84 oldType: "varchar(1000)",
85 oldMaxLength: 1000)
86 .Annotation("MySql:CharSet", "utf8mb4")
87 .OldAnnotation("MySql:CharSet", "utf8mb4");
88 }
89 }
90}