using System;
using LiteCharms.Features.Models;
using LiteCharms.Features.TechShop.Products.Models;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LiteCharms.Features.TechShop.Postgres.Migrations
{
///
public partial class AddedProductMetadata : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "Active",
table: "Products",
type: "boolean",
nullable: false,
defaultValue: false,
oldClrType: typeof(bool),
oldType: "boolean",
oldDefaultValue: true);
migrationBuilder.AddColumn(
name: "CreatedAt",
table: "Products",
type: "timestamp with time zone",
nullable: false,
defaultValueSql: "now()");
migrationBuilder.AddColumn(
name: "Metadata",
table: "Products",
type: "jsonb",
nullable: true);
migrationBuilder.AddColumn(
name: "UpdatedAt",
table: "Products",
type: "timestamp with time zone",
nullable: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreatedAt",
table: "Products");
migrationBuilder.DropColumn(
name: "Metadata",
table: "Products");
migrationBuilder.DropColumn(
name: "UpdatedAt",
table: "Products");
migrationBuilder.AlterColumn(
name: "Active",
table: "Products",
type: "boolean",
nullable: false,
defaultValue: true,
oldClrType: typeof(bool),
oldType: "boolean",
oldDefaultValue: false);
}
}
}