tethys.backend/app/Models/HashValue.ts
Arno Kaimbacher d8bdce1369
All checks were successful
CI Pipeline / japa-tests (push) Successful in 53s
- 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
850 B
TypeScript

import { column, BaseModel, belongsTo, BelongsTo, SnakeCaseNamingStrategy } from '@ioc:Adonis/Lucid/Orm';
import File from './File';
export default class HashValue extends BaseModel {
public static namingStrategy = new SnakeCaseNamingStrategy();
// public static primaryKey = 'file_id,type';
public static table = 'file_hashvalues';
// static get primaryKey () {
// return 'type, value'
// }
public static get incrementing() {
return false;
}
// @column({
// isPrimary: true,
// })
// public id: number;
// Foreign key is still on the same model
@column({ isPrimary: true })
public file_id: number;
@column({ isPrimary: true })
public type: string;
@column()
public value: string;
@belongsTo(() => File)
public file: BelongsTo<typeof File>;
}