File tree Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 1
1
import type { PrismaClient } from '@prisma/client'
2
-
3
- export interface ColumnOptions {
4
- name : string
5
- type : string
6
- required ?: boolean
7
- unique ?: boolean
8
- default ?: string
9
- }
10
-
11
- export interface ModelOptions {
12
- name : string
13
- columns : ColumnOptions [ ]
14
- }
2
+ import type { Model } from './model'
15
3
16
4
export type DatabaseClient = PrismaClient
17
5
@@ -29,7 +17,7 @@ export interface SchemaOptions {
29
17
30
18
export interface DatabaseDriver {
31
19
client : DatabaseClient
32
- migrate : ( models : ModelOptions , path : string , options ?: SchemaOptions ) => Promise < void >
20
+ migrate : ( models : Model , path : string , options ?: SchemaOptions ) => Promise < void >
33
21
seed : ( modelName : string , data : SeedData ) => Promise < void >
34
22
factory : ( modelName : string , fileName : string , path : string ) => Promise < void >
35
23
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export * from './layout'
19
19
export * from './library'
20
20
export * from './manifest'
21
21
export * from './markdown'
22
+ export * from './model'
22
23
export * from './notifications'
23
24
export * from './pages'
24
25
export * from './payments'
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Model.
3
+ */
4
+ export interface Model {
5
+ name : string
6
+ searchable ?: boolean // | IndexSettings,
7
+ columns : ColumnOptions [ ]
8
+ }
9
+
10
+ export interface ColumnOptions {
11
+ name : string
12
+ type : string
13
+ required ?: boolean
14
+ unique ?: boolean
15
+ default ?: string
16
+ }
You can’t perform that action at this time.
0 commit comments