using System; using Microsoft.EntityFrameworkCore.Migrations; namespace ViraScraper.Migrations { public partial class Init : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Hashtags", columns: table => new { HashtagId = table.Column(nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Tag = table.Column(nullable: true), CreationDate = table.Column(nullable: false), HashtagType = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Hashtags", x => x.HashtagId); }); migrationBuilder.CreateTable( name: "Synonymses", columns: table => new { SynonymsId = table.Column(nullable: false) .Annotation("SqlServer:Identity", "1, 1"), HashtagAId = table.Column(nullable: false), HashtagBId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Synonymses", x => x.SynonymsId); table.ForeignKey( name: "FK_Synonymses_Hashtags_HashtagAId", column: x => x.HashtagAId, principalTable: "Hashtags", principalColumn: "HashtagId", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Synonymses_Hashtags_HashtagBId", column: x => x.HashtagBId, principalTable: "Hashtags", principalColumn: "HashtagId", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Synonymses_HashtagAId", table: "Synonymses", column: "HashtagAId"); migrationBuilder.CreateIndex( name: "IX_Synonymses_HashtagBId", table: "Synonymses", column: "HashtagBId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Synonymses"); migrationBuilder.DropTable( name: "Hashtags"); } } }