using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SameBeat.Infrastructure.BazaDanych.Migracje
{
///
public partial class PoczatkowaStruktura : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SesjeWydarzen",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
WydarzenieId = table.Column(type: "uuid", nullable: false),
HostId = table.Column(type: "uuid", nullable: false),
RozpoczetoUtc = table.Column(type: "timestamp with time zone", nullable: false),
ZakonczonoUtc = table.Column(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SesjeWydarzen", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Uzytkownicy",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
Nick = table.Column(type: "character varying(64)", maxLength: 64, nullable: false),
HasloHash = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true),
Rola = table.Column(type: "character varying(32)", maxLength: 32, nullable: false),
UtworzonyUtc = table.Column(type: "timestamp with time zone", nullable: false),
Zbanowany = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Uzytkownicy", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Wydarzenia",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
Nazwa = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
Status = table.Column(type: "character varying(16)", maxLength: 16, nullable: false),
UtworzoneUtc = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Wydarzenia", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_SesjeWydarzen_WydarzenieId",
table: "SesjeWydarzen",
column: "WydarzenieId");
migrationBuilder.CreateIndex(
name: "IX_Uzytkownicy_Nick",
table: "Uzytkownicy",
column: "Nick",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SesjeWydarzen");
migrationBuilder.DropTable(
name: "Uzytkownicy");
migrationBuilder.DropTable(
name: "Wydarzenia");
}
}
}