using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Hutopy.Modules.Creators.Migrations { /// public partial class Initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "Creators"); migrationBuilder.CreateTable( name: "Creators", schema: "Creators", columns: table => new { Id = table.Column(type: "uuid", nullable: false), CreatedBy = table.Column(type: "uuid", nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), DeletedBy = table.Column(type: "uuid", nullable: true), DeletedAt = table.Column(type: "timestamp with time zone", nullable: true), IsDeleted = table.Column(type: "boolean", nullable: false, computedColumnSql: "\"DeletedAt\" IS NOT NULL", stored: true), BannerUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), PortraitUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), Verified = table.Column(type: "boolean", nullable: false), Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), Slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), Title = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), StripeAccountId = table.Column(type: "character varying(21)", maxLength: 21, nullable: true), IsStripeOnboardingComplete = table.Column(type: "boolean", nullable: false), IsStripePayoutReady = table.Column(type: "boolean", nullable: false), IsStripeChargesEnabled = table.Column(type: "boolean", nullable: false), AcceptDonation = table.Column(type: "boolean", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Creators", x => x.Id); }); migrationBuilder.CreateTable( name: "Slugs", schema: "Creators", columns: table => new { Id = table.Column(type: "uuid", nullable: false), CreatedBy = table.Column(type: "uuid", nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), UsedBy = table.Column(type: "uuid", nullable: true), Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), NormalizedName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false, computedColumnSql: "LOWER(\"Name\")", stored: true), ReservedUntil = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Slugs", x => x.Id); }); migrationBuilder.CreateTable( name: "Presentation", schema: "Creators", columns: table => new { CreatorId = table.Column(type: "uuid", nullable: false), Description = table.Column(type: "text", nullable: false), VideoUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), PhoneNumber = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true) }, constraints: table => { table.PrimaryKey("PK_Presentation", x => x.CreatorId); table.ForeignKey( name: "FK_Presentation_Creators_CreatorId", column: x => x.CreatorId, principalSchema: "Creators", principalTable: "Creators", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Socials", schema: "Creators", columns: table => new { CreatorId = table.Column(type: "uuid", nullable: false), FacebookUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), InstagramUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), XUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), LinkedInUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), TikTokUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), YoutubeUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), RedditUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), WebsiteUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true) }, constraints: table => { table.PrimaryKey("PK_Socials", x => x.CreatorId); table.ForeignKey( name: "FK_Socials_Creators_CreatorId", column: x => x.CreatorId, principalSchema: "Creators", principalTable: "Creators", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Slugs_NormalizedName", schema: "Creators", table: "Slugs", column: "NormalizedName", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Presentation", schema: "Creators"); migrationBuilder.DropTable( name: "Slugs", schema: "Creators"); migrationBuilder.DropTable( name: "Socials", schema: "Creators"); migrationBuilder.DropTable( name: "Creators", schema: "Creators"); } } }