tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20241103161845_MSAddAutoStartAndStop.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
8 public partial class MSAddAutoStartAndStop : 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: "nvarchar(1000)",
29 maxLength: 1000,
30 nullable: false,
31 oldClrType: typeof(string),
32 oldType: "nvarchar(max)",
33 oldMaxLength: 10000);
34
35 migrationBuilder.AddColumn<string>(
36 name: "AutoStartCron",
37 table: "Instances",
38 type: "nvarchar(1000)",
39 maxLength: 1000,
40 nullable: false,
41 defaultValue: String.Empty);
42
43 migrationBuilder.AddColumn<string>(
44 name: "AutoStopCron",
45 table: "Instances",
46 type: "nvarchar(1000)",
47 maxLength: 1000,
48 nullable: false,
49 defaultValue: String.Empty);
50 }
51
53 protected override void Down(MigrationBuilder migrationBuilder)
54 {
55 ArgumentNullException.ThrowIfNull(migrationBuilder);
56
57 migrationBuilder.DropColumn(
58 name: "AutoStartCron",
59 table: "Instances");
60
61 migrationBuilder.DropColumn(
62 name: "AutoStopCron",
63 table: "Instances");
64
65 migrationBuilder.AlterColumn<long>(
66 name: "UserId",
67 table: "OAuthConnections",
68 type: "bigint",
69 nullable: true,
70 oldClrType: typeof(long),
71 oldType: "bigint");
72
73 migrationBuilder.AlterColumn<string>(
74 name: "AutoUpdateCron",
75 table: "Instances",
76 type: "nvarchar(max)",
77 maxLength: 10000,
78 nullable: false,
79 oldClrType: typeof(string),
80 oldType: "nvarchar(1000)",
81 oldMaxLength: 1000);
82 }
83 }
84}