using Microsoft.EntityFrameworkCore.Migrations; using System; namespace Timeline.Migrations { public partial class PostData : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "content_type", table: "timeline_posts", type: "TEXT", nullable: true, oldClrType: typeof(string), oldType: "TEXT"); migrationBuilder.AddColumn( name: "deleted", table: "timeline_posts", type: "INTEGER", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "migrations", columns: table => new { id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), name = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_migrations", x => x.id); }); migrationBuilder.CreateTable( name: "timeline_post_data", columns: table => new { id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), post = table.Column(type: "INTEGER", nullable: false), index = table.Column(type: "INTEGER", nullable: false), kind = table.Column(type: "TEXT", nullable: false), data_tag = table.Column(type: "TEXT", nullable: false), last_updated = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_timeline_post_data", x => x.id); table.ForeignKey( name: "FK_timeline_post_data_timeline_posts_post", column: x => x.post, principalTable: "timeline_posts", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_timeline_post_data_post", table: "timeline_post_data", column: "post"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "migrations"); migrationBuilder.DropTable( name: "timeline_post_data"); migrationBuilder.DropColumn( name: "deleted", table: "timeline_posts"); migrationBuilder.AlterColumn( name: "content_type", table: "timeline_posts", type: "TEXT", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "TEXT", oldNullable: true); } } }