using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using eprintServer.Entities; #nullable disable namespace eprintServer.Migrations { /// public partial class InitialDatabaseSetup : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "contact_settings", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), email = table.Column(type: "text", nullable: false), phone = table.Column(type: "text", nullable: false), address = table.Column(type: "text", nullable: false), map_url = table.Column(type: "text", nullable: false), working_hours = table.Column(type: "text", nullable: false), email_recipients = table.Column>(type: "text[]", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_contact_settings", x => x.id); }); migrationBuilder.CreateTable( name: "Currencies", columns: table => new { Code = table.Column(type: "text", nullable: false), EnglishName = table.Column(type: "text", nullable: false), ArabicName = table.Column(type: "text", nullable: false), Symbol = table.Column(type: "text", nullable: false), IsDefault = table.Column(type: "boolean", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Currencies", x => x.Code); }); migrationBuilder.CreateTable( name: "faqs", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), question_en = table.Column(type: "text", nullable: false), question_ar = table.Column(type: "text", nullable: false), answer_en = table.Column(type: "text", nullable: false), answer_ar = table.Column(type: "text", nullable: false), is_active = table.Column(type: "boolean", nullable: false), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_faqs", x => x.id); }); migrationBuilder.CreateTable( name: "File_model", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), file_name = table.Column(type: "text", nullable: true), description = table.Column(type: "text", nullable: true), file_url = table.Column(type: "text", nullable: false), file_type = table.Column(type: "text", nullable: true), range = table.Column(type: "integer", nullable: true), share = table.Column(type: "boolean", nullable: false), file_size = table.Column(type: "bigint", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_File_model", x => x.id); }); migrationBuilder.CreateTable( name: "languages", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), tag = table.Column(type: "character varying(10)", maxLength: 10, nullable: false), direction = table.Column(type: "character varying(3)", maxLength: 3, nullable: false) }, constraints: table => { table.PrimaryKey("PK_languages", x => x.Id); }); migrationBuilder.CreateTable( name: "oauth_settings", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), google_client_id = table.Column(type: "text", nullable: false), google_client_secret = table.Column(type: "text", nullable: false), facebook_app_id = table.Column(type: "text", nullable: false), facebook_app_secret = table.Column(type: "text", nullable: false), instagram_app_id = table.Column(type: "text", nullable: false), instagram_app_secret = table.Column(type: "text", nullable: false), linkedin_client_id = table.Column(type: "text", nullable: false), linkedin_client_secret = table.Column(type: "text", nullable: false), ai_api_key = table.Column(type: "text", nullable: false), canva_key = table.Column(type: "text", nullable: false), thawani_root = table.Column(type: "text", nullable: false), thawani_checkout_model_url = table.Column(type: "text", nullable: false), thawani_api_key = table.Column(type: "text", nullable: false), thawani_public_key = table.Column(type: "text", nullable: false), assiyad_express_user_name = table.Column(type: "text", nullable: false), assiyad_express_password = table.Column(type: "text", nullable: false), twilio_account_sid = table.Column(type: "text", nullable: false), twilio_auth_token = table.Column(type: "text", nullable: false), twilio_phone_number = table.Column(type: "text", nullable: false), twilio_shippment_template = table.Column(type: "text", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_oauth_settings", x => x.id); }); migrationBuilder.CreateTable( name: "ReportSettings", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), DailyReports = table.Column(type: "boolean", nullable: false), WeeklyReports = table.Column(type: "boolean", nullable: false), MonthlyReports = table.Column(type: "boolean", nullable: false), YearlyReports = table.Column(type: "boolean", nullable: false), AdminEmailList = table.Column>(type: "text[]", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ReportSettings", x => x.Id); }); migrationBuilder.CreateTable( name: "revoked_tokens", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Token = table.Column(type: "character varying(500)", maxLength: 500, nullable: false), RevokedAt = table.Column(type: "timestamp without time zone", nullable: false), ExpiresAt = table.Column(type: "timestamp without time zone", nullable: true) }, constraints: table => { table.PrimaryKey("PK_revoked_tokens", x => x.Id); }); migrationBuilder.CreateTable( name: "step_templates", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), step_type = table.Column(type: "integer", nullable: false), archive = table.Column(type: "boolean", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_step_templates", x => x.id); }); migrationBuilder.CreateTable( name: "translation_settings_table", columns: table => new { Id = table.Column(type: "bigint", nullable: false), active_language_tags = table.Column(type: "varchar(500)", maxLength: 500, nullable: false) }, constraints: table => { table.PrimaryKey("PK_translation_settings_table", x => x.Id); }); migrationBuilder.CreateTable( name: "user_addresses", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), address_line1 = table.Column(type: "text", nullable: true), city = table.Column(type: "text", nullable: true), area = table.Column(type: "text", nullable: true), region = table.Column(type: "text", nullable: true), country = table.Column(type: "text", nullable: true), zip_code = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_user_addresses", x => x.id); }); migrationBuilder.CreateTable( name: "UserDevice", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), deviceType = table.Column(type: "text", nullable: true), device_Id = table.Column(type: "text", nullable: true), ip = table.Column(type: "text", nullable: true), token = table.Column(type: "text", nullable: true), tokendevice = table.Column(type: "text", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UserDevice", x => x.id); }); migrationBuilder.CreateTable( name: "blog_posts", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), author = table.Column(type: "text", nullable: false), published = table.Column(type: "boolean", nullable: false), image_id = table.Column(type: "bigint", nullable: true), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_blog_posts", x => x.id); table.ForeignKey( name: "FK_blog_posts_File_model_image_id", column: x => x.image_id, principalTable: "File_model", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "branding_colors", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), primary_color = table.Column(type: "text", nullable: false), secondary_color = table.Column(type: "text", nullable: false), accent_color = table.Column(type: "text", nullable: false), button_color = table.Column(type: "text", nullable: false), header_color = table.Column(type: "text", nullable: false), platform_name = table.Column(type: "text", nullable: false), platform_email = table.Column(type: "text", nullable: false), logo_id = table.Column(type: "bigint", nullable: true), favicon_id = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_branding_colors", x => x.id); table.ForeignKey( name: "FK_branding_colors_File_model_favicon_id", column: x => x.favicon_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_branding_colors_File_model_logo_id", column: x => x.logo_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateTable( name: "carousel_items", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), redirect_url = table.Column(type: "text", nullable: false), image_id = table.Column(type: "bigint", nullable: true), status = table.Column(type: "boolean", nullable: false), order_index = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_carousel_items", x => x.id); table.ForeignKey( name: "FK_carousel_items_File_model_image_id", column: x => x.image_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateTable( name: "offers_table", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Type = table.Column(type: "text", nullable: true), Status = table.Column(type: "text", nullable: true), OfferPrice = table.Column(type: "numeric", nullable: true), OriginalTotal = table.Column(type: "numeric", nullable: true), DiscountAmount = table.Column(type: "numeric", nullable: true), DiscountType = table.Column(type: "text", nullable: true), DiscountValue = table.Column(type: "numeric", nullable: true), DiscountPercentage = table.Column(type: "numeric", nullable: true), StartDate = table.Column(type: "timestamp without time zone", nullable: true), EndDate = table.Column(type: "timestamp without time zone", nullable: true), IsFeatured = table.Column(type: "boolean", nullable: true), IsActive = table.Column(type: "boolean", nullable: false), IsPublic = table.Column(type: "boolean", nullable: false), MaxUses = table.Column(type: "integer", nullable: true), CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), UpdatedAt = table.Column(type: "timestamp without time zone", nullable: false), BannerImageId = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_offers_table", x => x.id); table.ForeignKey( name: "FK_offers_table_File_model_BannerImageId", column: x => x.BannerImageId, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateTable( name: "product_categories", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), image_id = table.Column(type: "bigint", nullable: true), product_type = table.Column(type: "integer", nullable: false), archive = table.Column(type: "boolean", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_product_categories", x => x.id); table.ForeignKey( name: "FK_product_categories_File_model_image_id", column: x => x.image_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateTable( name: "users_table", columns: table => new { user_id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), user_name = table.Column(type: "text", nullable: false), email = table.Column(type: "text", nullable: false), password = table.Column(type: "text", nullable: false), name = table.Column(type: "text", nullable: false), gender = table.Column(type: "integer", nullable: true), phone_number = table.Column(type: "text", nullable: true), office_role = table.Column(type: "text", nullable: true), city = table.Column(type: "text", nullable: true), country = table.Column(type: "text", nullable: true), active = table.Column(type: "boolean", nullable: false), deleted = table.Column(type: "boolean", nullable: false), role = table.Column(type: "integer", nullable: false), user_device = table.Column(type: "bigint", nullable: true), otp = table.Column(type: "text", nullable: true), provider = table.Column(type: "integer", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false), users_profile_media = table.Column(type: "bigint", nullable: true), sub_admin_privileges = table.Column(type: "integer[]", nullable: false) }, constraints: table => { table.PrimaryKey("PK_users_table", x => x.user_id); table.ForeignKey( name: "FK_users_table_File_model_users_profile_media", column: x => x.users_profile_media, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_users_table_UserDevice_user_device", column: x => x.user_device, principalTable: "UserDevice", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "offer_products_table", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), OfferId = table.Column(type: "integer", nullable: false), ProductId = table.Column(type: "text", nullable: true), Quantity = table.Column(type: "integer", nullable: true), UnitPrice = table.Column(type: "numeric", nullable: true), ProductName = table.Column(type: "text", nullable: true), IsCustomizableProduct = table.Column(type: "boolean", nullable: false), ProductImageId = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_offer_products_table", x => x.Id); table.ForeignKey( name: "FK_offer_products_table_File_model_ProductImageId", column: x => x.ProductImageId, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_offer_products_table_offers_table_OfferId", column: x => x.OfferId, principalTable: "offers_table", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "customizable_products", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), base_price = table.Column(type: "numeric", nullable: false), is_canvas_enabled = table.Column(type: "boolean", nullable: false), minimum_order_quantity = table.Column(type: "integer", nullable: false), base_delivery_days = table.Column(type: "integer", nullable: false), allowed_quantities = table.Column>(type: "jsonb", nullable: true), category_id = table.Column(type: "bigint", nullable: false), quantity_pricing_config = table.Column(type: "jsonb", nullable: true), archive = table.Column(type: "boolean", nullable: false), unit_weight = table.Column(type: "numeric", nullable: true), image_id = table.Column(type: "bigint", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false), has_3d_preview = table.Column(type: "boolean", nullable: true), three_d_config = table.Column(type: "jsonb", nullable: true), uv_map_image_id = table.Column(type: "bigint", nullable: true), three_d_model_file_id = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_customizable_products", x => x.id); table.ForeignKey( name: "FK_customizable_products_File_model_image_id", column: x => x.image_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_customizable_products_File_model_three_d_model_file_id", column: x => x.three_d_model_file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_customizable_products_File_model_uv_map_image_id", column: x => x.uv_map_image_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_customizable_products_product_categories_category_id", column: x => x.category_id, principalTable: "product_categories", principalColumn: "id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "sellable_products", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), product_name_en = table.Column(type: "text", nullable: true), product_name_ar = table.Column(type: "text", nullable: true), price = table.Column(type: "double precision", nullable: false), stock_quantity = table.Column(type: "double precision", nullable: false), description_ar = table.Column(type: "text", maxLength: 3000, nullable: true), description_en = table.Column(type: "text", maxLength: 3000, nullable: true), status = table.Column(type: "integer", nullable: false), image_id = table.Column(type: "bigint", nullable: true), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false), category_id = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_sellable_products", x => x.id); table.ForeignKey( name: "FK_sellable_products_File_model_image_id", column: x => x.image_id, principalTable: "File_model", principalColumn: "id"); table.ForeignKey( name: "FK_sellable_products_product_categories_category_id", column: x => x.category_id, principalTable: "product_categories", principalColumn: "id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "notificationmodel", columns: table => new { notificatoin_id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), SenderId = table.Column(type: "bigint", nullable: true), ReciverId = table.Column(type: "bigint", nullable: true), action = table.Column(type: "integer", nullable: false), action_id = table.Column(type: "bigint", nullable: true), subject = table.Column(type: "text", nullable: false), content = table.Column(type: "text", nullable: false), logUrl = table.Column(type: "text", nullable: false), status = table.Column(type: "integer", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_notificationmodel", x => x.notificatoin_id); table.ForeignKey( name: "FK_notificationmodel_users_table_ReciverId", column: x => x.ReciverId, principalTable: "users_table", principalColumn: "user_id"); table.ForeignKey( name: "FK_notificationmodel_users_table_SenderId", column: x => x.SenderId, principalTable: "users_table", principalColumn: "user_id"); }); migrationBuilder.CreateTable( name: "Order", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), user_id = table.Column(type: "bigint", nullable: false), order_date = table.Column(type: "timestamp without time zone", nullable: false), total_amount = table.Column(type: "numeric", nullable: false), discount = table.Column(type: "numeric", nullable: false), status = table.Column(type: "integer", nullable: false), invoice_id = table.Column(type: "bigint", nullable: true), thawani_session_id = table.Column(type: "text", nullable: true), shipping_ref = table.Column(type: "text", nullable: true), batch_id = table.Column(type: "text", nullable: true), tracking_number = table.Column(type: "text", nullable: true), address_id = table.Column(type: "bigint", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Order", x => x.id); table.ForeignKey( name: "FK_Order_user_addresses_address_id", column: x => x.address_id, principalTable: "user_addresses", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Order_users_table_user_id", column: x => x.user_id, principalTable: "users_table", principalColumn: "user_id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "product_mockups", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "text", nullable: true), design_width = table.Column(type: "double precision", nullable: false), design_height = table.Column(type: "double precision", nullable: false), print_width = table.Column(type: "double precision", nullable: false), print_height = table.Column(type: "double precision", nullable: false), customizable_product_id = table.Column(type: "bigint", nullable: false), file_id = table.Column(type: "bigint", nullable: true), thumbnail_file_id = table.Column(type: "bigint", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_product_mockups", x => x.id); table.ForeignKey( name: "FK_product_mockups_File_model_file_id", column: x => x.file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_product_mockups_File_model_thumbnail_file_id", column: x => x.thumbnail_file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_product_mockups_customizable_products_customizable_product_~", column: x => x.customizable_product_id, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "steps", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), product_id = table.Column(type: "bigint", nullable: false), step_order = table.Column(type: "integer", nullable: false), step_type = table.Column(type: "integer", nullable: false), is_template = table.Column(type: "boolean", nullable: false), archive = table.Column(type: "boolean", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_steps", x => x.id); table.ForeignKey( name: "FK_steps_customizable_products_product_id", column: x => x.product_id, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "texture_slots", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "text", nullable: false), texture_type = table.Column(type: "integer", nullable: false), uv_coordinates = table.Column(type: "jsonb", nullable: false), file_id = table.Column(type: "bigint", nullable: true), customizable_product_id = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_texture_slots", x => x.id); table.ForeignKey( name: "FK_texture_slots_File_model_file_id", column: x => x.file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_texture_slots_customizable_products_customizable_product_id", column: x => x.customizable_product_id, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "user_customizations", columns: table => new { id = table.Column(type: "uuid", nullable: false), user_id = table.Column(type: "bigint", nullable: false), product_id = table.Column(type: "bigint", nullable: false), progress_id = table.Column(type: "uuid", nullable: false), status = table.Column(type: "integer", nullable: false), started_at = table.Column(type: "timestamp without time zone", nullable: false), completed_at = table.Column(type: "timestamp without time zone", nullable: true), total_price = table.Column(type: "numeric", nullable: false), order_id = table.Column(type: "bigint", nullable: true), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_customizations", x => x.id); table.ForeignKey( name: "FK_user_customizations_customizable_products_product_id", column: x => x.product_id, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "invoices", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), user_id = table.Column(type: "bigint", nullable: false), order_id = table.Column(type: "bigint", nullable: false), invoice_date = table.Column(type: "timestamp without time zone", nullable: false), total_amount = table.Column(type: "numeric", nullable: false), discount_percentage = table.Column(type: "double precision", nullable: false), discount_amount = table.Column(type: "numeric", nullable: false), tax_amount = table.Column(type: "numeric", nullable: false), status = table.Column(type: "integer", nullable: false), refund_date = table.Column(type: "timestamp without time zone", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_invoices", x => x.id); table.ForeignKey( name: "FK_invoices_Order_order_id", column: x => x.order_id, principalTable: "Order", principalColumn: "id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_invoices_users_table_user_id", column: x => x.user_id, principalTable: "users_table", principalColumn: "user_id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Payments", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), order_id = table.Column(type: "bigint", nullable: false), amount = table.Column(type: "numeric", nullable: false), discount = table.Column(type: "numeric", nullable: false), currency = table.Column(type: "text", nullable: false), status = table.Column(type: "integer", nullable: false), created_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Payments", x => x.id); table.ForeignKey( name: "fk_order", column: x => x.order_id, principalTable: "Order", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "form_elements", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), step_id = table.Column(type: "bigint", nullable: false), input_type = table.Column(type: "integer", nullable: false), field_name = table.Column(type: "text", nullable: false), is_required = table.Column(type: "boolean", nullable: false), element_order = table.Column(type: "integer", nullable: false), default_value = table.Column(type: "text", nullable: true), validation_rules = table.Column(type: "text", nullable: true), placeholder = table.Column(type: "text", nullable: true), price_config_type = table.Column(type: "integer", nullable: true), color_pricing_config = table.Column(type: "jsonb", nullable: true), quantity_pricing_config = table.Column(type: "jsonb", nullable: true), timestmp = table.Column(type: "timestamp without time zone", nullable: false), StepTemplateId = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_form_elements", x => x.id); table.ForeignKey( name: "FK_form_elements_step_templates_StepTemplateId", column: x => x.StepTemplateId, principalTable: "step_templates", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_form_elements_steps_step_id", column: x => x.step_id, principalTable: "steps", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "user_customization_steps", columns: table => new { id = table.Column(type: "uuid", nullable: false), user_customization_id = table.Column(type: "uuid", nullable: false), step_id = table.Column(type: "bigint", nullable: false), step_order = table.Column(type: "integer", nullable: false), step_name = table.Column(type: "text", nullable: false), is_completed = table.Column(type: "boolean", nullable: false), completed_at = table.Column(type: "timestamp without time zone", nullable: true), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_customization_steps", x => x.id); table.ForeignKey( name: "FK_user_customization_steps_user_customizations_user_customiza~", column: x => x.user_customization_id, principalTable: "user_customizations", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "OrderItem", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), order_id = table.Column(type: "bigint", nullable: false), sellable_product_id = table.Column(type: "integer", nullable: true), customizable_product_id = table.Column(type: "bigint", nullable: true), user_customization_id = table.Column(type: "uuid", nullable: true), offer_id = table.Column(type: "bigint", nullable: true), quantity = table.Column(type: "integer", nullable: false), unit_price = table.Column(type: "numeric", nullable: false), invoice_id = table.Column(type: "bigint", nullable: true), package_awb = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OrderItem", x => x.id); table.ForeignKey( name: "FK_OrderItem_Order_order_id", column: x => x.order_id, principalTable: "Order", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_OrderItem_customizable_products_customizable_product_id", column: x => x.customizable_product_id, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_OrderItem_invoices_invoice_id", column: x => x.invoice_id, principalTable: "invoices", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_OrderItem_sellable_products_sellable_product_id", column: x => x.sellable_product_id, principalTable: "sellable_products", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_OrderItem_user_customizations_user_customization_id", column: x => x.user_customization_id, principalTable: "user_customizations", principalColumn: "id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateTable( name: "form_element_options", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), form_element_id = table.Column(type: "bigint", nullable: false), option_value = table.Column(type: "text", nullable: false), option_order = table.Column(type: "integer", nullable: false), timestmp = table.Column(type: "timestamp without time zone", nullable: false), price_config = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_form_element_options", x => x.id); table.ForeignKey( name: "FK_form_element_options_form_elements_form_element_id", column: x => x.form_element_id, principalTable: "form_elements", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "user_canvas_designs", columns: table => new { id = table.Column(type: "uuid", nullable: false), user_customization_step_id = table.Column(type: "uuid", nullable: false), design_json_data = table.Column(type: "text", nullable: false), preview_image_url = table.Column(type: "text", nullable: true), canvas_provider = table.Column(type: "text", nullable: true), external_design_id = table.Column(type: "text", nullable: true), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_canvas_designs", x => x.id); table.ForeignKey( name: "FK_user_canvas_designs_user_customization_steps_user_customiza~", column: x => x.user_customization_step_id, principalTable: "user_customization_steps", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "user_customization_field_values", columns: table => new { id = table.Column(type: "uuid", nullable: false), user_customization_step_id = table.Column(type: "uuid", nullable: false), form_element_id = table.Column(type: "bigint", nullable: false), field_name = table.Column(type: "text", nullable: false), field_label = table.Column(type: "text", nullable: false), input_type = table.Column(type: "integer", nullable: false), field_value = table.Column(type: "text", nullable: false), created_at = table.Column(type: "timestamp without time zone", nullable: false), updated_at = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_customization_field_values", x => x.id); table.ForeignKey( name: "FK_user_customization_field_values_user_customization_steps_us~", column: x => x.user_customization_step_id, principalTable: "user_customization_steps", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "user_mockups", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), user_customization_step_id = table.Column(type: "uuid", nullable: false), print_width = table.Column(type: "double precision", nullable: true), print_height = table.Column(type: "double precision", nullable: true), file_id = table.Column(type: "bigint", nullable: true), thumbnail_file_id = table.Column(type: "bigint", nullable: true), timestamp = table.Column(type: "timestamp without time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_mockups", x => x.id); table.ForeignKey( name: "FK_user_mockups_File_model_file_id", column: x => x.file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_user_mockups_File_model_thumbnail_file_id", column: x => x.thumbnail_file_id, principalTable: "File_model", principalColumn: "id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_user_mockups_user_customization_steps_user_customization_st~", column: x => x.user_customization_step_id, principalTable: "user_customization_steps", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "dynamic_values", columns: table => new { id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), value = table.Column(type: "text", nullable: false), language_tag = table.Column(type: "varchar(10)", nullable: false), BlogContentId = table.Column(type: "integer", nullable: true), BlogTitleId = table.Column(type: "integer", nullable: true), CarouselButtonTextId = table.Column(type: "bigint", nullable: true), CarouselDescriptionId = table.Column(type: "bigint", nullable: true), CarouselTitleId = table.Column(type: "bigint", nullable: true), CustomizableProductDescriptionId = table.Column(type: "bigint", nullable: true), CustomizableProductNameId = table.Column(type: "bigint", nullable: true), FaqAnswerId = table.Column(type: "integer", nullable: true), FaqQuestionId = table.Column(type: "integer", nullable: true), FormElementLabelId = table.Column(type: "bigint", nullable: true), FormElementOptionLabelId = table.Column(type: "bigint", nullable: true), OfferDescriptionId = table.Column(type: "integer", nullable: true), OfferTitleId = table.Column(type: "integer", nullable: true), ProductCategoryId = table.Column(type: "bigint", nullable: true), SellableProductDescriptionId = table.Column(type: "integer", nullable: true), SellableProductNameId = table.Column(type: "integer", nullable: true), StepNameId = table.Column(type: "bigint", nullable: true), StepTemplateNameId = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_dynamic_values", x => x.id); table.ForeignKey( name: "FK_dynamic_values_blog_posts_BlogContentId", column: x => x.BlogContentId, principalTable: "blog_posts", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_blog_posts_BlogTitleId", column: x => x.BlogTitleId, principalTable: "blog_posts", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_carousel_items_CarouselButtonTextId", column: x => x.CarouselButtonTextId, principalTable: "carousel_items", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_carousel_items_CarouselDescriptionId", column: x => x.CarouselDescriptionId, principalTable: "carousel_items", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_carousel_items_CarouselTitleId", column: x => x.CarouselTitleId, principalTable: "carousel_items", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_customizable_products_CustomizableProductDes~", column: x => x.CustomizableProductDescriptionId, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_customizable_products_CustomizableProductNam~", column: x => x.CustomizableProductNameId, principalTable: "customizable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_faqs_FaqAnswerId", column: x => x.FaqAnswerId, principalTable: "faqs", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_faqs_FaqQuestionId", column: x => x.FaqQuestionId, principalTable: "faqs", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_form_element_options_FormElementOptionLabelId", column: x => x.FormElementOptionLabelId, principalTable: "form_element_options", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_form_elements_FormElementLabelId", column: x => x.FormElementLabelId, principalTable: "form_elements", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_offers_table_OfferDescriptionId", column: x => x.OfferDescriptionId, principalTable: "offers_table", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_offers_table_OfferTitleId", column: x => x.OfferTitleId, principalTable: "offers_table", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_product_categories_ProductCategoryId", column: x => x.ProductCategoryId, principalTable: "product_categories", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_sellable_products_SellableProductDescription~", column: x => x.SellableProductDescriptionId, principalTable: "sellable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_sellable_products_SellableProductNameId", column: x => x.SellableProductNameId, principalTable: "sellable_products", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_step_templates_StepTemplateNameId", column: x => x.StepTemplateNameId, principalTable: "step_templates", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_dynamic_values_steps_StepNameId", column: x => x.StepNameId, principalTable: "steps", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_blog_posts_image_id", table: "blog_posts", column: "image_id"); migrationBuilder.CreateIndex( name: "IX_branding_colors_favicon_id", table: "branding_colors", column: "favicon_id", unique: true); migrationBuilder.CreateIndex( name: "IX_branding_colors_logo_id", table: "branding_colors", column: "logo_id", unique: true); migrationBuilder.CreateIndex( name: "IX_carousel_items_image_id", table: "carousel_items", column: "image_id", unique: true); migrationBuilder.CreateIndex( name: "IX_customizable_products_category_id", table: "customizable_products", column: "category_id"); migrationBuilder.CreateIndex( name: "IX_customizable_products_image_id", table: "customizable_products", column: "image_id", unique: true); migrationBuilder.CreateIndex( name: "IX_customizable_products_three_d_model_file_id", table: "customizable_products", column: "three_d_model_file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_customizable_products_uv_map_image_id", table: "customizable_products", column: "uv_map_image_id", unique: true); migrationBuilder.CreateIndex( name: "IX_dynamic_values_BlogContentId", table: "dynamic_values", column: "BlogContentId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_BlogTitleId", table: "dynamic_values", column: "BlogTitleId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_CarouselButtonTextId", table: "dynamic_values", column: "CarouselButtonTextId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_CarouselDescriptionId", table: "dynamic_values", column: "CarouselDescriptionId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_CarouselTitleId", table: "dynamic_values", column: "CarouselTitleId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_CustomizableProductDescriptionId", table: "dynamic_values", column: "CustomizableProductDescriptionId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_CustomizableProductNameId", table: "dynamic_values", column: "CustomizableProductNameId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_FaqAnswerId", table: "dynamic_values", column: "FaqAnswerId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_FaqQuestionId", table: "dynamic_values", column: "FaqQuestionId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_FormElementLabelId", table: "dynamic_values", column: "FormElementLabelId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_FormElementOptionLabelId", table: "dynamic_values", column: "FormElementOptionLabelId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_OfferDescriptionId", table: "dynamic_values", column: "OfferDescriptionId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_OfferTitleId", table: "dynamic_values", column: "OfferTitleId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_ProductCategoryId", table: "dynamic_values", column: "ProductCategoryId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_SellableProductDescriptionId", table: "dynamic_values", column: "SellableProductDescriptionId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_SellableProductNameId", table: "dynamic_values", column: "SellableProductNameId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_StepNameId", table: "dynamic_values", column: "StepNameId"); migrationBuilder.CreateIndex( name: "IX_dynamic_values_StepTemplateNameId", table: "dynamic_values", column: "StepTemplateNameId"); migrationBuilder.CreateIndex( name: "IX_form_element_options_form_element_id", table: "form_element_options", column: "form_element_id"); migrationBuilder.CreateIndex( name: "IX_form_elements_step_id", table: "form_elements", column: "step_id"); migrationBuilder.CreateIndex( name: "IX_form_elements_StepTemplateId", table: "form_elements", column: "StepTemplateId"); migrationBuilder.CreateIndex( name: "IX_invoices_order_id", table: "invoices", column: "order_id"); migrationBuilder.CreateIndex( name: "IX_invoices_user_id", table: "invoices", column: "user_id"); migrationBuilder.CreateIndex( name: "IX_languages_tag", table: "languages", column: "tag", unique: true); migrationBuilder.CreateIndex( name: "IX_notificationmodel_ReciverId", table: "notificationmodel", column: "ReciverId"); migrationBuilder.CreateIndex( name: "IX_notificationmodel_SenderId", table: "notificationmodel", column: "SenderId"); migrationBuilder.CreateIndex( name: "IX_offer_products_table_OfferId", table: "offer_products_table", column: "OfferId"); migrationBuilder.CreateIndex( name: "IX_offer_products_table_ProductImageId", table: "offer_products_table", column: "ProductImageId", unique: true); migrationBuilder.CreateIndex( name: "IX_offers_table_BannerImageId", table: "offers_table", column: "BannerImageId", unique: true); migrationBuilder.CreateIndex( name: "IX_Order_address_id", table: "Order", column: "address_id"); migrationBuilder.CreateIndex( name: "IX_Order_user_id", table: "Order", column: "user_id"); migrationBuilder.CreateIndex( name: "IX_OrderItem_customizable_product_id", table: "OrderItem", column: "customizable_product_id"); migrationBuilder.CreateIndex( name: "IX_OrderItem_invoice_id", table: "OrderItem", column: "invoice_id"); migrationBuilder.CreateIndex( name: "IX_OrderItem_order_id", table: "OrderItem", column: "order_id"); migrationBuilder.CreateIndex( name: "IX_OrderItem_sellable_product_id", table: "OrderItem", column: "sellable_product_id"); migrationBuilder.CreateIndex( name: "IX_OrderItem_user_customization_id", table: "OrderItem", column: "user_customization_id"); migrationBuilder.CreateIndex( name: "IX_Payments_order_id", table: "Payments", column: "order_id"); migrationBuilder.CreateIndex( name: "IX_product_categories_image_id", table: "product_categories", column: "image_id", unique: true); migrationBuilder.CreateIndex( name: "IX_product_mockups_customizable_product_id", table: "product_mockups", column: "customizable_product_id"); migrationBuilder.CreateIndex( name: "IX_product_mockups_file_id", table: "product_mockups", column: "file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_product_mockups_thumbnail_file_id", table: "product_mockups", column: "thumbnail_file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_revoked_tokens_Token", table: "revoked_tokens", column: "Token", unique: true); migrationBuilder.CreateIndex( name: "IX_sellable_products_category_id", table: "sellable_products", column: "category_id"); migrationBuilder.CreateIndex( name: "IX_sellable_products_image_id", table: "sellable_products", column: "image_id"); migrationBuilder.CreateIndex( name: "IX_steps_product_id", table: "steps", column: "product_id"); migrationBuilder.CreateIndex( name: "IX_texture_slots_customizable_product_id", table: "texture_slots", column: "customizable_product_id"); migrationBuilder.CreateIndex( name: "IX_texture_slots_file_id", table: "texture_slots", column: "file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_user_canvas_designs_user_customization_step_id", table: "user_canvas_designs", column: "user_customization_step_id", unique: true); migrationBuilder.CreateIndex( name: "IX_user_customization_field_values_user_customization_step_id", table: "user_customization_field_values", column: "user_customization_step_id"); migrationBuilder.CreateIndex( name: "IX_user_customization_steps_user_customization_id", table: "user_customization_steps", column: "user_customization_id"); migrationBuilder.CreateIndex( name: "IX_user_customizations_product_id", table: "user_customizations", column: "product_id"); migrationBuilder.CreateIndex( name: "IX_user_customizations_progress_id", table: "user_customizations", column: "progress_id", unique: true); migrationBuilder.CreateIndex( name: "IX_user_customizations_user_id", table: "user_customizations", column: "user_id"); migrationBuilder.CreateIndex( name: "IX_user_mockups_file_id", table: "user_mockups", column: "file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_user_mockups_thumbnail_file_id", table: "user_mockups", column: "thumbnail_file_id", unique: true); migrationBuilder.CreateIndex( name: "IX_user_mockups_user_customization_step_id", table: "user_mockups", column: "user_customization_step_id", unique: true); migrationBuilder.CreateIndex( name: "IX_users_table_email", table: "users_table", column: "email", unique: true); migrationBuilder.CreateIndex( name: "IX_users_table_user_device", table: "users_table", column: "user_device", unique: true); migrationBuilder.CreateIndex( name: "IX_users_table_user_name", table: "users_table", column: "user_name", unique: true); migrationBuilder.CreateIndex( name: "IX_users_table_users_profile_media", table: "users_table", column: "users_profile_media", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "branding_colors"); migrationBuilder.DropTable( name: "contact_settings"); migrationBuilder.DropTable( name: "Currencies"); migrationBuilder.DropTable( name: "dynamic_values"); migrationBuilder.DropTable( name: "languages"); migrationBuilder.DropTable( name: "notificationmodel"); migrationBuilder.DropTable( name: "oauth_settings"); migrationBuilder.DropTable( name: "offer_products_table"); migrationBuilder.DropTable( name: "OrderItem"); migrationBuilder.DropTable( name: "Payments"); migrationBuilder.DropTable( name: "product_mockups"); migrationBuilder.DropTable( name: "ReportSettings"); migrationBuilder.DropTable( name: "revoked_tokens"); migrationBuilder.DropTable( name: "texture_slots"); migrationBuilder.DropTable( name: "translation_settings_table"); migrationBuilder.DropTable( name: "user_canvas_designs"); migrationBuilder.DropTable( name: "user_customization_field_values"); migrationBuilder.DropTable( name: "user_mockups"); migrationBuilder.DropTable( name: "blog_posts"); migrationBuilder.DropTable( name: "carousel_items"); migrationBuilder.DropTable( name: "faqs"); migrationBuilder.DropTable( name: "form_element_options"); migrationBuilder.DropTable( name: "offers_table"); migrationBuilder.DropTable( name: "invoices"); migrationBuilder.DropTable( name: "sellable_products"); migrationBuilder.DropTable( name: "user_customization_steps"); migrationBuilder.DropTable( name: "form_elements"); migrationBuilder.DropTable( name: "Order"); migrationBuilder.DropTable( name: "user_customizations"); migrationBuilder.DropTable( name: "step_templates"); migrationBuilder.DropTable( name: "steps"); migrationBuilder.DropTable( name: "user_addresses"); migrationBuilder.DropTable( name: "users_table"); migrationBuilder.DropTable( name: "customizable_products"); migrationBuilder.DropTable( name: "UserDevice"); migrationBuilder.DropTable( name: "product_categories"); migrationBuilder.DropTable( name: "File_model"); } } }