Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/add default values for countries and sectors (#1133)

Thomas Kaul573038f407d7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90bb3a2756..03ee8091b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added `url` to the symbol profile overrides model for manual adjustments
+- Added default values for `countries` and `sectors` of the symbol profile overrides model
### Changed
diff --git a/package.json b/package.json
index 6791763c93..c3e1e9b2a6 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"database:push": "prisma db push",
"database:seed": "prisma db seed",
"database:setup": "yarn database:push && yarn database:seed && yarn database:baseline",
+ "database:validate": "prisma validate",
"dep-graph": "nx dep-graph",
"e2e": "ng e2e",
"format": "nx format:write",
diff --git a/prisma/migrations/20220808191912_added_default_value_for_countries_of_symbol_profile_overrides/migration.sql b/prisma/migrations/20220808191912_added_default_value_for_countries_of_symbol_profile_overrides/migration.sql
new file mode 100644
index 0000000000..3b1702f100
--- /dev/null
+++ b/prisma/migrations/20220808191912_added_default_value_for_countries_of_symbol_profile_overrides/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "SymbolProfileOverrides" ALTER COLUMN "countries" SET DEFAULT '[]';
diff --git a/prisma/migrations/20220808192002_added_default_value_for_sectors_of_symbol_profile_overrides/migration.sql b/prisma/migrations/20220808192002_added_default_value_for_sectors_of_symbol_profile_overrides/migration.sql
new file mode 100644
index 0000000000..3b11db82de
--- /dev/null
+++ b/prisma/migrations/20220808192002_added_default_value_for_sectors_of_symbol_profile_overrides/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "SymbolProfileOverrides" ALTER COLUMN "sectors" SET DEFAULT '[]';
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 12eb5690d1..6009f4544d 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -133,9 +133,9 @@ model SymbolProfile {
model SymbolProfileOverrides {
assetClass AssetClass?
assetSubClass AssetSubClass?
- countries Json?
+ countries Json? @default("[]")
name String?
- sectors Json?
+ sectors Json? @default("[]")
url String?
symbolProfileId String @id
updatedAt DateTime @updatedAt