Closed ahmzus closed 2 months ago
-- Table structure for table brands
CREATE TABLE brands ( id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, status int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table categories CREATE TABLE categories ( id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, status int(11) DEFAULT 1, showHome int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table countries CREATE TABLE countries ( id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, code varchar(10) DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table customer_addresses CREATE TABLE customer_addresses ( id bigint(20) UNSIGNED NOT NULL, user_id bigint(20) UNSIGNED NOT NULL, first_name varchar(255) DEFAULT NULL, last_name varchar(255) DEFAULT NULL, email varchar(255) DEFAULT NULL, mobile varchar(20) DEFAULT NULL, country_id bigint(20) UNSIGNED DEFAULT NULL, address text DEFAULT NULL, apartment varchar(255) DEFAULT NULL, state varchar(255) DEFAULT NULL, city varchar(255) DEFAULT NULL, zip varchar(10) DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table discount_coupons CREATE TABLE discount_coupons ( id bigint(20) UNSIGNED NOT NULL, code varchar(255) NOT NULL, discount decimal(10,2) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table migrations CREATE TABLE migrations ( id int(10) UNSIGNED NOT NULL, migration varchar(255) NOT NULL, batch int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- -- Dumping data for table migrations INSERT INTO migrations (id, migration, batch) VALUES (1, '2019_12_14_000001_create_personal_access_tokens_table', 1);
-- -- Table structure for table orders CREATE TABLE orders ( id bigint(20) UNSIGNED NOT NULL, user_id bigint(20) UNSIGNED NOT NULL, discount_coupon_id bigint(20) UNSIGNED DEFAULT NULL, total decimal(10,2) DEFAULT NULL, status varchar(255) DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table order_items CREATE TABLE order_items ( id bigint(20) UNSIGNED NOT NULL, order_id bigint(20) UNSIGNED NOT NULL, product_id bigint(20) UNSIGNED NOT NULL, quantity int(11) NOT NULL, price decimal(10,2) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table pages CREATE TABLE pages ( id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, content text DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table personal_access_tokens CREATE TABLE personal_access_tokens ( id bigint(20) UNSIGNED NOT NULL, tokenable_type varchar(255) NOT NULL, tokenable_id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, token varchar(64) NOT NULL, abilities text DEFAULT NULL, last_used_at timestamp NULL DEFAULT NULL, expires_at timestamp NULL DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- -- Table structure for table products CREATE TABLE products ( id bigint(20) UNSIGNED NOT NULL, brand_id bigint(20) UNSIGNED NOT NULL, category_id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, description text DEFAULT NULL, price decimal(10,2) NOT NULL, stock int(11) DEFAULT 0, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, is_featured text DEFAULT 'Yes', status int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table product_images CREATE TABLE product_images ( id bigint(20) UNSIGNED NOT NULL, product_id bigint(20) UNSIGNED NOT NULL, image_path varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table product_ratings CREATE TABLE product_ratings ( id bigint(20) UNSIGNED NOT NULL, product_id bigint(20) UNSIGNED NOT NULL, user_id bigint(20) UNSIGNED NOT NULL, rating int(11) DEFAULT NULL CHECK (rating >= 1 and rating <= 5), review text DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table shipping_charges CREATE TABLE shipping_charges ( id bigint(20) UNSIGNED NOT NULL, country_id bigint(20) UNSIGNED DEFAULT NULL, charge decimal(10,2) DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table sub_categories CREATE TABLE sub_categories ( id bigint(20) UNSIGNED NOT NULL, category_id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table temp_images CREATE TABLE temp_images ( id bigint(20) UNSIGNED NOT NULL, image_path varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Table structure for table users CREATE TABLE users ( id bigint(20) UNSIGNED NOT NULL, name varchar(255) NOT NULL, email varchar(255) NOT NULL, password varchar(255) NOT NULL, email_verified_at timestamp NULL DEFAULT NULL, remember_token varchar(100) DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, phone text NOT NULL, role enum('1','2') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- -- Dumping data for table users INSERT INTO users (id, name, email, password, email_verified_at, remember_token, created_at, updated_at, phone, role) VALUES (1, 'Admin', 'admin@gmail.com', '$2y$10$l3PiWLU.yz5LCvFT3fvyC.VVb81yedyuV4YhX2XVdV/KoTlJdJxZK', '2024-09-09 12:49:36', NULL, '2024-09-09 12:49:36', '2024-09-09 12:49:36', '', '2'), (2, 'User', 'user@gmail.com', '$2y$10$zBJhHHaL0jgkppQfuuqDNelbN22UOy9Ko4QIG9JYqCZSBIaf5tdV.', NULL, NULL, '2024-09-09 07:23:34', '2024-09-09 07:23:34', '1234567890', '1');
-- -- Table structure for table wishlists CREATE TABLE wishlists ( id bigint(20) UNSIGNED NOT NULL, user_id bigint(20) UNSIGNED NOT NULL, product_id bigint(20) UNSIGNED NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Indexes for table brands ALTER TABLE brands ADD PRIMARY KEY (id);
-- -- Indexes for table categories ALTER TABLE categories ADD PRIMARY KEY (id);
-- -- Indexes for table countries ALTER TABLE countries ADD PRIMARY KEY (id);
-- -- Indexes for table customer_addresses ALTER TABLE customer_addresses ADD PRIMARY KEY (id), ADD KEY user_id (user_id), ADD KEY country_id (country_id);
-- -- Indexes for table discount_coupons ALTER TABLE discount_coupons ADD PRIMARY KEY (id);
-- -- Indexes for table migrations ALTER TABLE migrations ADD PRIMARY KEY (id);
-- -- Indexes for table orders ALTER TABLE orders ADD PRIMARY KEY (id), ADD KEY user_id (user_id), ADD KEY discount_coupon_id (discount_coupon_id);
-- -- Indexes for table order_items ALTER TABLE order_items ADD PRIMARY KEY (id), ADD KEY order_id (order_id), ADD KEY product_id (product_id);
-- -- Indexes for table pages ALTER TABLE pages ADD PRIMARY KEY (id);
-- -- Indexes for table personal_access_tokens ALTER TABLE personal_access_tokens ADD PRIMARY KEY (id), ADD UNIQUE KEY personal_access_tokens_token_unique (token), ADD KEY personal_access_tokens_tokenable_type_tokenable_id_index (tokenable_type,tokenable_id);
-- -- Indexes for table products ALTER TABLE products ADD PRIMARY KEY (id), ADD KEY brand_id (brand_id), ADD KEY category_id (category_id);
-- -- Indexes for table product_images ALTER TABLE product_images ADD PRIMARY KEY (id), ADD KEY product_id (product_id);
-- -- Indexes for table product_ratings ALTER TABLE product_ratings ADD PRIMARY KEY (id), ADD KEY product_id (product_id), ADD KEY user_id (user_id);
-- -- Indexes for table shipping_charges ALTER TABLE shipping_charges ADD PRIMARY KEY (id), ADD KEY country_id (country_id);
-- -- Indexes for table sub_categories ALTER TABLE sub_categories ADD PRIMARY KEY (id), ADD KEY category_id (category_id);
-- -- Indexes for table temp_images ALTER TABLE temp_images ADD PRIMARY KEY (id);
-- -- Indexes for table users ALTER TABLE users ADD PRIMARY KEY (id), ADD UNIQUE KEY email (email);
-- -- Indexes for table wishlists ALTER TABLE wishlists ADD PRIMARY KEY (id), ADD KEY user_id (user_id), ADD KEY product_id (product_id);
-- AUTO_INCREMENT for table brands ALTER TABLE brands MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table categories ALTER TABLE categories MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table countries ALTER TABLE countries MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table customer_addresses ALTER TABLE customer_addresses MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table discount_coupons ALTER TABLE discount_coupons MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table migrations ALTER TABLE migrations MODIFY id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
-- -- AUTO_INCREMENT for table orders ALTER TABLE orders MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table order_items ALTER TABLE order_items MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table pages ALTER TABLE pages MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table personal_access_tokens ALTER TABLE personal_access_tokens MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table products ALTER TABLE products MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table product_images ALTER TABLE product_images MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table product_ratings ALTER TABLE product_ratings MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table shipping_charges ALTER TABLE shipping_charges MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table sub_categories ALTER TABLE sub_categories MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table temp_images ALTER TABLE temp_images MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- -- AUTO_INCREMENT for table users ALTER TABLE users MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
-- -- AUTO_INCREMENT for table wishlists ALTER TABLE wishlists MODIFY id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
-- Constraints for table customer_addresses ALTER TABLE customer_addresses ADD CONSTRAINT customer_addresses_ibfk_1 FOREIGN KEY (user_id) REFERENCES users (id), ADD CONSTRAINT customer_addresses_ibfk_2 FOREIGN KEY (country_id) REFERENCES countries (id);
-- -- Constraints for table orders ALTER TABLE orders ADD CONSTRAINT orders_ibfk_1 FOREIGN KEY (user_id) REFERENCES users (id), ADD CONSTRAINT orders_ibfk_2 FOREIGN KEY (discount_coupon_id) REFERENCES discount_coupons (id);
-- -- Constraints for table order_items ALTER TABLE order_items ADD CONSTRAINT order_items_ibfk_1 FOREIGN KEY (order_id) REFERENCES orders (id), ADD CONSTRAINT order_items_ibfk_2 FOREIGN KEY (product_id) REFERENCES products (id);
-- -- Constraints for table products ALTER TABLE products ADD CONSTRAINT products_ibfk_1 FOREIGN KEY (brand_id) REFERENCES brands (id), ADD CONSTRAINT products_ibfk_2 FOREIGN KEY (category_id) REFERENCES categories (id);
-- -- Constraints for table product_images ALTER TABLE product_images ADD CONSTRAINT product_images_ibfk_1 FOREIGN KEY (product_id) REFERENCES products (id);
-- -- Constraints for table product_ratings ALTER TABLE product_ratings ADD CONSTRAINT product_ratings_ibfk_1 FOREIGN KEY (product_id) REFERENCES products (id), ADD CONSTRAINT product_ratings_ibfk_2 FOREIGN KEY (user_id) REFERENCES users (id);
-- -- Constraints for table shipping_charges ALTER TABLE shipping_charges ADD CONSTRAINT shipping_charges_ibfk_1 FOREIGN KEY (country_id) REFERENCES countries (id);
-- -- Constraints for table sub_categories ALTER TABLE sub_categories ADD CONSTRAINT sub_categories_ibfk_1 FOREIGN KEY (category_id) REFERENCES categories (id);
-- -- Constraints for table wishlists ALTER TABLE wishlists ADD CONSTRAINT wishlists_ibfk_1 FOREIGN KEY (user_id) REFERENCES users (id), ADD CONSTRAINT wishlists_ibfk_2 FOREIGN KEY (product_id) REFERENCES products (id); COMMIT;
account/login user@gmail.com 1243456
/admin/login admin@gmail.com 123456
Same issue Can't migrate due to missing Database folder and the owner i guess intentionally added that in the gitignore file