-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55b7d35
commit 5d33c2c
Showing
13 changed files
with
446 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
250 changes: 250 additions & 0 deletions
250
...elf.OneDragon/OneShelf.OneDragon.Database/Migrations/20240819203114_AddLimits.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
OneShelf.OneDragon/OneShelf.OneDragon.Database/Migrations/20240819203114_AddLimits.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace OneShelf.OneDragon.Database.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddLimits : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<bool>( | ||
name: "UseLimits", | ||
table: "Users", | ||
type: "bit", | ||
nullable: false, | ||
defaultValue: false); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Limits", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(type: "int", nullable: false) | ||
.Annotation("SqlServer:Identity", "1, 1"), | ||
Images = table.Column<int>(type: "int", nullable: true), | ||
Texts = table.Column<int>(type: "int", nullable: true), | ||
Window = table.Column<long>(type: "bigint", nullable: false), | ||
IsEnabled = table.Column<bool>(type: "bit", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Limits", x => x.Id); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Limits"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "UseLimits", | ||
table: "Users"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
OneShelf.OneDragon/OneShelf.OneDragon.Database/Model/Limit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace OneShelf.OneDragon.Database.Model; | ||
|
||
public class Limit | ||
{ | ||
public int Id { get; set; } | ||
|
||
public int? Images { get; set; } | ||
|
||
public int? Texts { get; set; } | ||
|
||
[Column(TypeName = "bigint")] | ||
public required TimeSpan Window { get; set; } | ||
|
||
public bool IsEnabled { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.