diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..0ef0302 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["prisma.prisma", "esbenp.prettier-vscode"] +} diff --git a/prisma/mysql.prisma b/prisma/mysql.prisma index 3a12000..68e462e 100755 --- a/prisma/mysql.prisma +++ b/prisma/mysql.prisma @@ -53,11 +53,12 @@ model Category { } model Company { - id Int @id - name String - totalIncome BigInt @default(100) - lat Decimal - lng Decimal - by Bytes - products Product[] + id Int @id + name String + totalIncome BigInt @default(100) + lat Decimal + lng Decimal + by Bytes + products Product[] + establishedAt DateTime @default("2000-01-01T01:00:00.00Z") } diff --git a/src/components/field.component.ts b/src/components/field.component.ts index 06390e2..9c78f2d 100755 --- a/src/components/field.component.ts +++ b/src/components/field.component.ts @@ -26,7 +26,11 @@ export class FieldComponent extends BaseComponent implements Echoable { let defaultValue = '' if (this.default) { - defaultValue = `= ${this.default}` + if (!isNaN(Date.parse(this.default))) { + defaultValue = `= new Date('${this.default}')` + } else { + defaultValue = `= ${this.default}` + } } else { if (this.useUndefinedDefault === true) { defaultValue = `= undefined`