using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LightlessSyncServer.Migrations { /// public partial class AddGroupProfilesAndDates : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "created_date", table: "groups", type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"); migrationBuilder.AddColumn( name: "from_finder", table: "group_pairs", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "joined_group_on", table: "group_pairs", type: "timestamp with time zone", nullable: true); migrationBuilder.CreateTable( name: "group_profiles", columns: table => new { group_gid = table.Column(type: "character varying(20)", nullable: false), description = table.Column(type: "text", nullable: true), tags = table.Column(type: "text", nullable: true), base64group_profile_image = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("pk_group_profiles", x => x.group_gid); table.ForeignKey( name: "fk_group_profiles_groups_group_gid", column: x => x.group_gid, principalTable: "groups", principalColumn: "gid", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "ix_group_profiles_group_gid", table: "group_profiles", column: "group_gid"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "group_profiles"); migrationBuilder.DropColumn( name: "created_date", table: "groups"); migrationBuilder.DropColumn( name: "from_finder", table: "group_pairs"); migrationBuilder.DropColumn( name: "joined_group_on", table: "group_pairs"); } } }