36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace UserPointManagement.Persistence.Migrations
|
|
{
|
|
public partial class AddUserPoint : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "user_point",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
user_id = table.Column<int>(type: "integer", nullable: false, comment: "用户Id"),
|
|
point = table.Column<int>(type: "integer", nullable: false, comment: "积分"),
|
|
create_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "新增时间")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_user_point", x => x.id);
|
|
});
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "user_point");
|
|
}
|
|
}
|
|
}
|