using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DramaLing.Api.Migrations
{
///
public partial class AddOptionsVocabularyTable : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "options_vocabularies",
columns: table => new
{
Id = table.Column(type: "TEXT", nullable: false),
Word = table.Column(type: "TEXT", maxLength: 100, nullable: false),
cefr_level = table.Column(type: "TEXT", maxLength: 2, nullable: false),
part_of_speech = table.Column(type: "TEXT", maxLength: 20, nullable: false),
word_length = table.Column(type: "INTEGER", nullable: false),
is_active = table.Column(type: "INTEGER", nullable: false, defaultValue: true),
created_at = table.Column(type: "TEXT", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
updated_at = table.Column(type: "TEXT", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PK_options_vocabularies", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_Active",
table: "options_vocabularies",
column: "is_active");
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_CEFR",
table: "options_vocabularies",
column: "cefr_level");
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_Core_Matching",
table: "options_vocabularies",
columns: new[] { "cefr_level", "part_of_speech", "word_length" });
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_PartOfSpeech",
table: "options_vocabularies",
column: "part_of_speech");
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_Word",
table: "options_vocabularies",
column: "Word",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_OptionsVocabulary_WordLength",
table: "options_vocabularies",
column: "word_length");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "options_vocabularies");
}
}
}