Arno Kaimbacher
d8bdce1369
All checks were successful
CI Pipeline / japa-tests (push) Successful in 53s
- added API File Controller for downloading files e.g. /api/download/1022 - also create has codes by submitting new dataset - added edit dataset functionalities for role submitter - added the following route for role submitter: /dataset/:id/update', 'DatasetController.update' - created extra UpdateDatasetValidator.ts for validating updated dataset - npm updates
35 lines
851 B
TypeScript
35 lines
851 B
TypeScript
import { column, belongsTo, BelongsTo } from '@ioc:Adonis/Lucid/Orm';
|
|
import Dataset from './Dataset';
|
|
import BaseModel from './BaseModel';
|
|
// import { DatasetRelatedBaseModel } from './BaseModel';
|
|
|
|
export default class Title extends BaseModel {
|
|
public static primaryKey = 'id';
|
|
public static table = 'dataset_titles';
|
|
public static selfAssignPrimaryKey = false;
|
|
public static timestamps = false;
|
|
public static fillable: string[] = ['value', 'type', 'language'];
|
|
|
|
@column({
|
|
isPrimary: true,
|
|
})
|
|
public id: number;
|
|
|
|
@column({})
|
|
public document_id: number;
|
|
|
|
@column()
|
|
public type: string;
|
|
|
|
@column()
|
|
public value: string;
|
|
|
|
@column()
|
|
public language: string;
|
|
|
|
@belongsTo(() => Dataset, {
|
|
foreignKey: 'document_id',
|
|
})
|
|
public dataset: BelongsTo<typeof Dataset>;
|
|
}
|