Browse Source

fix(core): Remove null defaults from entity fields

Fixes #244
Michael Bromley 6 years ago
parent
commit
98bff33004

+ 1 - 1
packages/core/src/entity/customer/customer.entity.ts

@@ -24,7 +24,7 @@ export class Customer extends VendureEntity implements HasCustomFields, SoftDele
         super(input);
     }
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     deletedAt: Date | null;
 
     @Column({ nullable: true })

+ 1 - 1
packages/core/src/entity/product-variant/product-variant.entity.ts

@@ -35,7 +35,7 @@ export class ProductVariant extends VendureEntity implements Translatable, HasCu
         super(input);
     }
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     deletedAt: Date | null;
 
     name: LocaleString;

+ 1 - 1
packages/core/src/entity/product/product.entity.ts

@@ -29,7 +29,7 @@ export class Product extends VendureEntity
         super(input);
     }
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     deletedAt: Date | null;
 
     name: LocaleString;

+ 5 - 5
packages/core/src/entity/promotion/promotion.entity.ts

@@ -59,19 +59,19 @@ export class Promotion extends AdjustmentSource implements ChannelAware, SoftDel
         this.allActions = actions.reduce((hash, o) => ({ ...hash, [o.code]: o }), {});
     }
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     deletedAt: Date | null;
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     startsAt: Date | null;
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     endsAt: Date | null;
 
-    @Column({ nullable: true, default: null })
+    @Column({ nullable: true })
     couponCode: string;
 
-    @Column({ nullable: true, default: null })
+    @Column({ nullable: true })
     perCustomerUsageLimit: number;
 
     @Column() name: string;

+ 1 - 1
packages/core/src/entity/shipping-method/shipping-method.entity.ts

@@ -36,7 +36,7 @@ export class ShippingMethod extends VendureEntity implements ChannelAware, SoftD
         this.allCalculators = calculators.reduce((hash, o) => ({ ...hash, [o.code]: o }), {});
     }
 
-    @Column({ type: Date, nullable: true, default: null })
+    @Column({ type: Date, nullable: true })
     deletedAt: Date | null;
 
     @Column() code: string;