forked from geolba/tethys.backend
- add references, collections and identifiers to dataset model
- npm updates
This commit is contained in:
parent
f6d735d0fd
commit
5f8fe1c16d
9 changed files with 459 additions and 346 deletions
|
@ -23,6 +23,8 @@ import Subject from './Subject';
|
|||
import File from './File';
|
||||
import Coverage from './Coverage';
|
||||
import DatasetReference from './DatasetReference';
|
||||
import Collection from './Collection';
|
||||
import DatasetIdentifier from './DatasetIdentifier';
|
||||
|
||||
export default class Dataset extends BaseModel {
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
|
@ -144,6 +146,23 @@ export default class Dataset extends BaseModel {
|
|||
})
|
||||
public references: HasMany<typeof DatasetReference>;
|
||||
|
||||
// public function collections()
|
||||
// {
|
||||
// return $this
|
||||
// ->belongsToMany(Collection::class, 'link_documents_collections', 'document_id', 'collection_id');
|
||||
// }
|
||||
@manyToMany(() => Collection, {
|
||||
pivotForeignKey: 'document_id',
|
||||
pivotRelatedForeignKey: 'collection_id',
|
||||
pivotTable: 'link_documents_collections',
|
||||
})
|
||||
public collections: ManyToMany<typeof Collection>;
|
||||
|
||||
@hasOne(() => DatasetIdentifier, {
|
||||
foreignKey: 'document_id',
|
||||
})
|
||||
public identifier: HasOne<typeof DatasetIdentifier>;
|
||||
|
||||
|
||||
@computed({
|
||||
serializeAs: 'main_title',
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue