mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
ce013eae49
+ InvitesRepository + AdminsRepository + rework jwt
70 lines
2.3 KiB
C#
70 lines
2.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Govor.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class inviteAdd : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "InviteId",
|
|
table: "Users",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Invitations",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
IsAdmin = table.Column<bool>(type: "boolean", nullable: false),
|
|
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
EndDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
MaxParticipants = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Invitations", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Users_InviteId",
|
|
table: "Users",
|
|
column: "InviteId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Users_Invitations_InviteId",
|
|
table: "Users",
|
|
column: "InviteId",
|
|
principalTable: "Invitations",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Users_Invitations_InviteId",
|
|
table: "Users");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Invitations");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Users_InviteId",
|
|
table: "Users");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "InviteId",
|
|
table: "Users");
|
|
}
|
|
}
|
|
}
|