tethys.backend/app/Models/Title.ts
Arno Kaimbacher d8bdce1369 - added npm package dotenv-webpack for using env variables on clientside
- 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
2023-11-22 17:06:55 +01:00

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>;
}