mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 21:00:06 +01:00
feat: add db model for statistics
This commit is contained in:
43
Migrations/20250721081641_sitewide_statistics.cs
Normal file
43
Migrations/20250721081641_sitewide_statistics.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace QuotifyBE.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class sitewide_statistics : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Statistics",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Label = table.Column<string>(type: "text", nullable: false),
|
||||
IValue = table.Column<int>(type: "integer", nullable: true),
|
||||
SValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Statistics", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Statistics_Label",
|
||||
table: "Statistics",
|
||||
column: "Label",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Statistics");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user