using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SameBeat.Infrastructure.BazaDanych.Migracje
{
///
public partial class DodanoMuzyke : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "CzasStartuUtc",
table: "Wydarzenia",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn(
name: "GlosnoscMaster",
table: "Wydarzenia",
type: "real",
nullable: false,
defaultValue: 0.9f);
migrationBuilder.AddColumn(
name: "PozycjaStartowaMs",
table: "Wydarzenia",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "StanOdtwarzania",
table: "Wydarzenia",
type: "character varying(16)",
maxLength: 16,
nullable: false,
defaultValue: "Zatrzymana");
migrationBuilder.AddColumn(
name: "UtworId",
table: "Wydarzenia",
type: "uuid",
nullable: true);
migrationBuilder.CreateTable(
name: "PozycjePlaylisty",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
WydarzenieId = table.Column(type: "uuid", nullable: false),
UtworId = table.Column(type: "uuid", nullable: false),
Kolejnosc = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PozycjePlaylisty", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Utwory",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
Tytul = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
Wykonawca = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
Url = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false),
CzasTrwaniaMs = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Utwory", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_PozycjePlaylisty_WydarzenieId_Kolejnosc",
table: "PozycjePlaylisty",
columns: new[] { "WydarzenieId", "Kolejnosc" },
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PozycjePlaylisty");
migrationBuilder.DropTable(
name: "Utwory");
migrationBuilder.DropColumn(
name: "CzasStartuUtc",
table: "Wydarzenia");
migrationBuilder.DropColumn(
name: "GlosnoscMaster",
table: "Wydarzenia");
migrationBuilder.DropColumn(
name: "PozycjaStartowaMs",
table: "Wydarzenia");
migrationBuilder.DropColumn(
name: "StanOdtwarzania",
table: "Wydarzenia");
migrationBuilder.DropColumn(
name: "UtworId",
table: "Wydarzenia");
}
}
}