108 lines
3.5 KiB
C#
108 lines
3.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace DramaLing.Api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdatePronunciationAssessmentForAzureSpeech : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.RenameColumn(
|
|
name: "target_text",
|
|
table: "pronunciation_assessments",
|
|
newName: "transcribed_text");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "suggestions",
|
|
table: "pronunciation_assessments",
|
|
newName: "word_level_results");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "phoneme_scores",
|
|
table: "pronunciation_assessments",
|
|
newName: "feedback");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "audio_url",
|
|
table: "pronunciation_assessments",
|
|
newName: "azure_request_id");
|
|
|
|
migrationBuilder.AlterColumn<decimal>(
|
|
name: "overall_score",
|
|
table: "pronunciation_assessments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
oldClrType: typeof(int),
|
|
oldType: "INTEGER");
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "audio_duration",
|
|
table: "pronunciation_assessments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: 0m);
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "processing_time",
|
|
table: "pronunciation_assessments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: 0m);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "reference_text",
|
|
table: "pronunciation_assessments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: "");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "audio_duration",
|
|
table: "pronunciation_assessments");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "processing_time",
|
|
table: "pronunciation_assessments");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "reference_text",
|
|
table: "pronunciation_assessments");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "word_level_results",
|
|
table: "pronunciation_assessments",
|
|
newName: "suggestions");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "transcribed_text",
|
|
table: "pronunciation_assessments",
|
|
newName: "target_text");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "feedback",
|
|
table: "pronunciation_assessments",
|
|
newName: "phoneme_scores");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "azure_request_id",
|
|
table: "pronunciation_assessments",
|
|
newName: "audio_url");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "overall_score",
|
|
table: "pronunciation_assessments",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
oldClrType: typeof(decimal),
|
|
oldType: "TEXT");
|
|
}
|
|
}
|
|
}
|