using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Govor.Data.Migrations { /// public partial class initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ChatGroups", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Name = table.Column(type: "text", nullable: false), InviteCode = table.Column>(type: "text[]", nullable: false), IsChannel = table.Column(type: "boolean", nullable: false), IsPrivate = table.Column(type: "boolean", nullable: false), Admins = table.Column>(type: "uuid[]", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ChatGroups", x => x.Id); }); migrationBuilder.CreateTable( name: "GroupAdmins", columns: table => new { Id = table.Column(type: "uuid", nullable: false), GroupId = table.Column(type: "uuid", nullable: false), UserId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_GroupAdmins", x => x.Id); }); migrationBuilder.CreateTable( name: "GroupMemberships", columns: table => new { Id = table.Column(type: "uuid", nullable: false), GroupId = table.Column(type: "uuid", nullable: false), UserId = table.Column(type: "uuid", nullable: false), IsBanned = table.Column(type: "boolean", nullable: false) }, constraints: table => { table.PrimaryKey("PK_GroupMemberships", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Username = table.Column(type: "text", nullable: false), Description = table.Column(type: "text", nullable: false), HashPassword = table.Column(type: "text", nullable: false), IconId = table.Column(type: "uuid", nullable: false), CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), WasOnline = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ChatGroups"); migrationBuilder.DropTable( name: "GroupAdmins"); migrationBuilder.DropTable( name: "GroupMemberships"); migrationBuilder.DropTable( name: "Users"); } } }