mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add Archive model and update context for archive statistics
This commit is contained in:
@@ -46,6 +46,9 @@ public sealed class AaruContext : DbContext
|
|||||||
/// <param name="options">Options</param>
|
/// <param name="options">Options</param>
|
||||||
public AaruContext(DbContextOptions options) : base(options) {}
|
public AaruContext(DbContextOptions options) : base(options) {}
|
||||||
|
|
||||||
|
/// <summary>Statistics for archives</summary>
|
||||||
|
public DbSet<Archive> Archives { get; set; }
|
||||||
|
|
||||||
/// <summary>List of known devices</summary>
|
/// <summary>List of known devices</summary>
|
||||||
public DbSet<Device> Devices { get; set; }
|
public DbSet<Device> Devices { get; set; }
|
||||||
|
|
||||||
|
|||||||
2937
Aaru.Database/Migrations/20250928010213_AddArchiveToStat.Designer.cs
generated
Normal file
2937
Aaru.Database/Migrations/20250928010213_AddArchiveToStat.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
36
Aaru.Database/Migrations/20250928010213_AddArchiveToStat.cs
Normal file
36
Aaru.Database/Migrations/20250928010213_AddArchiveToStat.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Aaru.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddArchiveToStat : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Archives",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||||
|
.Annotation("Sqlite:Autoincrement", true),
|
||||||
|
Name = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
Synchronized = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||||
|
Count = table.Column<ulong>(type: "INTEGER", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Archives", x => x.Id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Archives");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ namespace Aaru.Database.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "9.0.0")
|
.HasAnnotation("ProductVersion", "10.0.0-preview.7.25380.108")
|
||||||
.HasAnnotation("Proxies:ChangeTracking", false)
|
.HasAnnotation("Proxies:ChangeTracking", false)
|
||||||
.HasAnnotation("Proxies:CheckEquality", false)
|
.HasAnnotation("Proxies:CheckEquality", false)
|
||||||
.HasAnnotation("Proxies:LazyLoading", true);
|
.HasAnnotation("Proxies:LazyLoading", true);
|
||||||
@@ -2010,6 +2010,26 @@ namespace Aaru.Database.Migrations
|
|||||||
b.ToTable("Usb");
|
b.ToTable("Usb");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Aaru.Database.Models.Archive", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<ulong>("Count")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<bool>("Synchronized")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Archives");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Aaru.Database.Models.CdOffset", b =>
|
modelBuilder.Entity("Aaru.Database.Models.CdOffset", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
|
|||||||
37
Aaru.Database/Models/Archive.cs
Normal file
37
Aaru.Database/Models/Archive.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// Aaru Data Preservation Suite
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : MediaFormat.cs
|
||||||
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// Component : Database.
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Model for storing archive statistics in database.
|
||||||
|
//
|
||||||
|
// --[ License ] --------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation; either version 2.1 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright © 2011-2025 Natalia Portillo
|
||||||
|
// ****************************************************************************/
|
||||||
|
|
||||||
|
namespace Aaru.Database.Models;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>Media image format</summary>
|
||||||
|
public class Archive : NameCountModel;
|
||||||
Reference in New Issue
Block a user