1631786ce2
Add push contracts, provider delivery and channel diagnostics. Link email channels to services and document migration and validation. Ref: IT-1074
52 lines
2.0 KiB
C#
52 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace HrynCo.NotificationService.DAL.EF.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddPushChannels : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "push_channels",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
service_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
firebase_project_id = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
|
credentials = table.Column<string>(type: "jsonb", nullable: false),
|
|
is_active = table.Column<bool>(type: "boolean", nullable: false),
|
|
created = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
updated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_push_channels", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_push_channels_services_service_id",
|
|
column: x => x.service_id,
|
|
principalTable: "services",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_push_channels_service_id",
|
|
table: "push_channels",
|
|
column: "service_id",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "push_channels");
|
|
}
|
|
}
|
|
}
|