diff options
Diffstat (limited to 'Migrations/20221121025210_AddRaffle.cs')
-rw-r--r-- | Migrations/20221121025210_AddRaffle.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Migrations/20221121025210_AddRaffle.cs b/Migrations/20221121025210_AddRaffle.cs new file mode 100644 index 0000000..af039bd --- /dev/null +++ b/Migrations/20221121025210_AddRaffle.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace BackendPIA.Migrations +{ + /// <inheritdoc /> + public partial class AddRaffle : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Raffles", + columns: table => new + { + Id = table.Column<long>(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false), + Winners = table.Column<int>(type: "integer", nullable: false), + IsClosed = table.Column<bool>(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Raffles", x => x.Id); + }); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Raffles"); + } + } +} |