diff --git a/scripts/02-create-products.sql b/scripts/02-create-products.sql index 4ef0d8b..e187d44 100644 --- a/scripts/02-create-products.sql +++ b/scripts/02-create-products.sql @@ -9,7 +9,7 @@ USE `heroku_c0edb524a9c3c7d` ; -- ----------------------------------------------------- -- Table `full-stack-ecommerce`.`product_category` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `heroku_c0edb524a9c3c7d`.`product_category` ( +CREATE TABLE IF NOT EXISTS `mpvmweiv00pv3pt2`.`product_category` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `category_name` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`id`)) @@ -19,7 +19,7 @@ AUTO_INCREMENT = 1; -- ----------------------------------------------------- -- Table `full-stack-ecommerce`.`product` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `heroku_c0edb524a9c3c7d`.`product` ( +CREATE TABLE IF NOT EXISTS `mpvmweiv00pv3pt2`.`product` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `sku` VARCHAR(255) DEFAULT NULL, `name` VARCHAR(255) DEFAULT NULL, diff --git a/scripts/03-refresh-database-with-100-products.sql b/scripts/03-refresh-database-with-100-products.sql index 5ebb100..27a3d6b 100644 --- a/scripts/03-refresh-database-with-100-products.sql +++ b/scripts/03-refresh-database-with-100-products.sql @@ -1,15 +1,12 @@ -- ----------------------------------------------------- -- Schema full-stack-ecommerce -- ----------------------------------------------------- -DROP SCHEMA IF EXISTS `full-stack-ecommerce`; - -CREATE SCHEMA `full-stack-ecommerce`; -USE `full-stack-ecommerce` ; +USE `mpvmweiv00pv3pt2` ; -- ----------------------------------------------------- -- Table `full-stack-ecommerce`.`product_category` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `full-stack-ecommerce`.`product_category` ( +CREATE TABLE IF NOT EXISTS `mpvmweiv00pv3pt2`.`product_category` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `category_name` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`id`)) @@ -19,7 +16,7 @@ AUTO_INCREMENT = 1; -- ----------------------------------------------------- -- Table `full-stack-ecommerce`.`product` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `full-stack-ecommerce`.`product` ( +CREATE TABLE IF NOT EXISTS `mpvmweiv00pv3pt2`.`product` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `sku` VARCHAR(255) DEFAULT NULL, `name` VARCHAR(255) DEFAULT NULL, diff --git a/src/main/java/com/victorgarciarubio/ecommerce/dao/CountryRepository.java b/src/main/java/com/victorgarciarubio/ecommerce/dao/CountryRepository.java index 03aa88b..40cbccc 100644 --- a/src/main/java/com/victorgarciarubio/ecommerce/dao/CountryRepository.java +++ b/src/main/java/com/victorgarciarubio/ecommerce/dao/CountryRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.web.bind.annotation.CrossOrigin; -@CrossOrigin("http://localhost:4200") +@CrossOrigin(origins = {"https://ecommerce-app.victorgarciarubio.com", "https://frontend-ecommerce-angular.vercel.app"}) @RepositoryRestResource(collectionResourceRel = "countries", path="countries") public interface CountryRepository extends JpaRepository{ diff --git a/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductCategoryRepository.java b/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductCategoryRepository.java index b934df8..40e5296 100644 --- a/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductCategoryRepository.java +++ b/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductCategoryRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.web.bind.annotation.CrossOrigin; -@CrossOrigin("http://localhost:4200") +@CrossOrigin(origins = {"https://ecommerce-app.victorgarciarubio.com", "https://frontend-ecommerce-angular.vercel.app"}) @RepositoryRestResource(collectionResourceRel = "productCategory", path = "product-category") public interface ProductCategoryRepository extends JpaRepository{ diff --git a/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductRepository.java b/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductRepository.java index 9746a01..214a6d3 100644 --- a/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductRepository.java +++ b/src/main/java/com/victorgarciarubio/ecommerce/dao/ProductRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestParam; -@CrossOrigin("http://localhost:4200") +@CrossOrigin(origins = {"https://ecommerce-app.victorgarciarubio.com", "https://frontend-ecommerce-angular.vercel.app"}) @RepositoryRestResource(collectionResourceRel = "products", path = "products") public interface ProductRepository extends JpaRepository{ diff --git a/src/main/java/com/victorgarciarubio/ecommerce/dao/StateRepository.java b/src/main/java/com/victorgarciarubio/ecommerce/dao/StateRepository.java index c30cb56..8511650 100644 --- a/src/main/java/com/victorgarciarubio/ecommerce/dao/StateRepository.java +++ b/src/main/java/com/victorgarciarubio/ecommerce/dao/StateRepository.java @@ -9,7 +9,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.web.bind.annotation.CrossOrigin; -@CrossOrigin("http://localhost:4200") +@CrossOrigin(origins = {"https://ecommerce-app.victorgarciarubio.com", "https://frontend-ecommerce-angular.vercel.app"}) @RepositoryRestResource(collectionResourceRel = "states", path="states") public interface StateRepository extends JpaRepository{