-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use db model instead of content type (#19563)
* chore: use db model instead of content type * chore: remove content type ref in comment * fix: remove contentTypes from CM index * fix: yet another model import * fix: mark feedback
- Loading branch information
Showing
8 changed files
with
63 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 0 additions & 64 deletions
64
packages/core/content-manager/server/src/history/content-types/history-version.ts
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/core/content-manager/server/src/history/content-types/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/core/content-manager/server/src/history/models/history-version.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { Model } from '@strapi/database'; | ||
import { HISTORY_VERSION_UID } from '../constants'; | ||
|
||
const historyVersion: Model = { | ||
uid: HISTORY_VERSION_UID, | ||
tableName: 'strapi_history_versions', | ||
singularName: 'history-version', | ||
attributes: { | ||
id: { | ||
type: 'increments', | ||
}, | ||
contentType: { | ||
type: 'string', | ||
column: { notNullable: true }, | ||
}, | ||
relatedDocumentId: { | ||
type: 'string', | ||
column: { notNullable: true }, | ||
}, | ||
locale: { | ||
type: 'string', | ||
}, | ||
status: { | ||
type: 'enumeration', | ||
enum: ['draft', 'published', 'modified'], | ||
}, | ||
data: { | ||
type: 'json', | ||
}, | ||
schema: { | ||
type: 'json', | ||
}, | ||
createdAt: { | ||
type: 'datetime', | ||
default: () => new Date(), | ||
}, | ||
// FIXME: joinTable should be optional | ||
// @ts-expect-error database model is not yet updated to support useJoinTable | ||
createdBy: { | ||
type: 'relation', | ||
relation: 'oneToOne', | ||
target: 'admin::user', | ||
useJoinTable: false, | ||
}, | ||
}, | ||
}; | ||
|
||
export { historyVersion }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters