-
Notifications
You must be signed in to change notification settings - Fork 492
Expand file tree
/
Copy path20230503180337_CreateOffersTable.cs
More file actions
40 lines (35 loc) · 1.45 KB
/
20230503180337_CreateOffersTable.cs
File metadata and controls
40 lines (35 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#nullable disable
namespace SuperSimpleArchitecture.Fitnet.Migrations.OffersPersistenceMigrations;
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.EntityFrameworkCore.Migrations;
[ExcludeFromCodeCoverage]
public partial class CreateOffersTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "Offers");
migrationBuilder.CreateTable(
name: "Offers",
schema: "Offers",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CustomerId = table.Column<Guid>(type: "uuid", nullable: false),
PreparedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
Discount = table.Column<decimal>(type: "numeric", nullable: false),
OfferedFromDate = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
OfferedFromTo = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Offers", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable(
name: "Offers",
schema: "Offers");
}