mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-08-11 11:42:03 +00:00
42 lines
1.6 KiB
C#
42 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace barkmanapi.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddCustomerModel : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "customers",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
name = table.Column<string>(type: "text", nullable: false),
|
|
company = table.Column<string>(type: "text", nullable: true),
|
|
email = table.Column<string>(type: "text", nullable: false),
|
|
phone_number = table.Column<string>(type: "text", nullable: false),
|
|
address = table.Column<string>(type: "text", nullable: true),
|
|
billing_terms = table.Column<string>(type: "text", nullable: true),
|
|
notes = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_customers", x => x.id);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "customers");
|
|
}
|
|
}
|
|
}
|