diff options
Diffstat (limited to 'app/Models/Recipe.ts')
-rw-r--r-- | app/Models/Recipe.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/Models/Recipe.ts b/app/Models/Recipe.ts new file mode 100644 index 0000000..fce5f3d --- /dev/null +++ b/app/Models/Recipe.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import { DateTime } from 'luxon'; | ||
2 | import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'; | ||
3 | |||
4 | export default class Recipe extends BaseModel { | ||
5 | @column({ isPrimary: true }) | ||
6 | public id: number; | ||
7 | |||
8 | @column() | ||
9 | public name: string; | ||
10 | |||
11 | @column() | ||
12 | public recipeId: string; | ||
13 | |||
14 | // TODO: Type the data object. | ||
15 | @column() | ||
16 | public data: object; | ||
17 | |||
18 | @column.dateTime({ autoCreate: true }) | ||
19 | public createdAt: DateTime; | ||
20 | |||
21 | @column.dateTime({ autoCreate: true, autoUpdate: true }) | ||
22 | public updatedAt: DateTime; | ||
23 | } | ||