File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
storage/framework/core/database/src/drivers Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -145,12 +145,10 @@ async function createTableMigration(modelPath: string) {
145
145
await createPivotTableMigration ( model )
146
146
147
147
const modelFiles = glob . sync ( path . userModelsPath ( '*.ts' ) )
148
-
149
148
const otherModelRelations = await fetchOtherModelRelations ( model , modelFiles )
150
-
151
- const fields = model . attributes as Attributes
152
- const useTimestamps = model ?. traits ?. useTimestamps ?? model ?. traits ?. timestampable
153
- const useSoftDeletes = model ?. traits ?. useSoftDeletes ?? model ?. traits ?. softDeletable
149
+ const fields = model . attributes
150
+ const useTimestamps = model ?. traits ?. useTimestamps ?? model ?. traits ?. timestampable ?? true
151
+ const useSoftDeletes = model ?. traits ?. useSoftDeletes ?? model ?. traits ?. softDeletable ?? false
154
152
155
153
let migrationContent = `import type { Database } from '@stacksjs/database'\n`
156
154
migrationContent += `import { sql } from '@stacksjs/database'\n\n`
Original file line number Diff line number Diff line change @@ -123,8 +123,8 @@ async function createTableMigration(modelPath: string) {
123
123
const modelFiles = glob . sync ( path . userModelsPath ( '*.ts' ) )
124
124
const otherModelRelations = await fetchOtherModelRelations ( model , modelFiles )
125
125
const fields = model . attributes
126
- const useTimestamps = model . traits ?. useTimestamps ?? model . traits ?. timestampable
127
- const useSoftDeletes = model . traits ?. useSoftDeletes ?? model . traits ?. softDeletable
126
+ const useTimestamps = model . traits ?. useTimestamps ?? model . traits ?. timestampable ?? true
127
+ const useSoftDeletes = model . traits ?. useSoftDeletes ?? model . traits ?. softDeletable ?? false
128
128
129
129
let migrationContent = `import type { Database } from '@stacksjs/database'\n`
130
130
migrationContent += `import { sql } from '@stacksjs/database'\n\n`
Original file line number Diff line number Diff line change @@ -142,12 +142,10 @@ async function createTableMigration(modelPath: string): Promise<void> {
142
142
143
143
await createPivotTableMigration ( model )
144
144
const modelFiles = glob . sync ( path . userModelsPath ( '*.ts' ) )
145
-
146
145
const otherModelRelations = await fetchOtherModelRelations ( model , modelFiles )
147
-
148
- const fields = model . attributes as Attributes
149
- const useTimestamps = model ?. traits ?. useTimestamps ?? model ?. traits ?. timestampable
150
- const useSoftDeletes = model ?. traits ?. useSoftDeletes ?? model ?. traits ?. softDeletable
146
+ const fields = model . attributes
147
+ const useTimestamps = model ?. traits ?. useTimestamps ?? model ?. traits ?. timestampable ?? true
148
+ const useSoftDeletes = model ?. traits ?. useSoftDeletes ?? model ?. traits ?. softDeletable ?? false
151
149
152
150
let migrationContent = `import type { Database } from '@stacksjs/database'\n`
153
151
migrationContent += `import { sql } from '@stacksjs/database'\n\n`
You can’t perform that action at this time.
0 commit comments