tachybase_todo/packages/plugins/snapshot-field/src/server/collections/collectionsHistory.ts
anuoua 6febdb041a
feat: snapshot field plugin (#1253)
* feat: snapshort init

* feat: snapshot update yarn.lock

* feat: snapshot add to preset

* feat: snapshot add field fix

* feat: snapshot remove Table Column SnapshotField

* feat: snapshot field label fix

* feat: snapshot request error fix

* feat: snapshot 二级关联数据打开

* feat: snapshot batch edit fix

* feat: snapshot 2 level draw fix

* feat: snapshot translate

* feat: snapshot global historyCollection provider

* feat: snapshot install initial

* feat: snapshot refreshCH

* feat: snapshot add transaction

* feat: snapshot default collecitonField

* feat: snapshot build fix

* feat: snapshot useSnapshotFieldTargetCollectionKey

* feat: snapshot batch update

* feat: snapshot linkto support

* feat: snapshot use getRepository

* feat: snapshot recreate fix

* feat: snapshot collectionKey to collectionName & rebuild collection

* feat: snapshot remove SnapshotHistoryCollectionProvider & collectionName

* feat: snapshot use historyCollections in inherit table

* feat: snapshot fix TableSelectorBlock appends

* feat: snapshot kanban fix

* feat: snapshot snapshot association field fix

* feat: snapshot add CollectionFieldProvider fallback

* feat: snapshot AssociationSelect fix

* feat: snapshot TableField fix
2023-01-04 19:27:37 +08:00

56 lines
1.0 KiB
TypeScript

import { CollectionOptions } from '@nocobase/database';
export default {
name: 'collectionsHistory',
title: '数据表历史',
sortable: 'sort',
autoGenId: false,
model: 'CollectionModel',
repository: 'CollectionRepository',
timestamps: false,
filterTargetKey: 'name',
fields: [
{
type: 'uid',
name: 'key',
primaryKey: true,
},
{
type: 'uid',
name: 'name',
unique: true,
prefix: 't_',
},
{
type: 'string',
name: 'title',
required: true,
},
{
type: 'boolean',
name: 'inherit',
defaultValue: false,
},
{
type: 'boolean',
name: 'hidden',
defaultValue: false,
},
{
type: 'json',
name: 'options',
defaultValue: {},
},
{
type: 'hasMany',
name: 'fields',
target: 'fieldsHistory',
sourceKey: 'name',
targetKey: 'name',
foreignKey: 'collectionName',
onDelete: 'CASCADE',
sortBy: 'sort',
},
],
} as CollectionOptions;