Skip to content

Commit

Permalink
fix(core): Fix postgres error when specifying custom fields
Browse files Browse the repository at this point in the history
For now I have just made all custom fields nullable. In future (see #85) there will be more control over this in the custom field config.

Fixes #101
  • Loading branch information
michaelbromley committed May 29, 2019
1 parent e1fecbb commit d8b6c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/entity/custom-entity-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function registerCustomFieldsForEntity(
for (const customField of customFields) {
const { name, type } = customField;
const registerColumn = () =>
Column({ type: getColumnType(dbEngine, type), name })(new ctor(), name);
Column({ type: getColumnType(dbEngine, type), name, nullable: true })(new ctor(), name);

if (translation) {
if (type === 'localeString') {
Expand Down
2 changes: 2 additions & 0 deletions packages/dev-server/dev-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function getDbConfig(): ConnectionOptions {
case 'postgres':
console.log('Using postgres connection');
return {
synchronize: true,
type: 'postgres',
host: '127.0.0.1',
port: 5432,
Expand All @@ -83,6 +84,7 @@ function getDbConfig(): ConnectionOptions {
default:
console.log('Using mysql connection');
return {
synchronize: true,
type: 'mysql',
host: '192.168.99.100',
port: 3306,
Expand Down

0 comments on commit d8b6c47

Please sign in to comment.