Arno Kaimbacher
c4f4eff0d9
All checks were successful
CI Pipeline / japa-tests (push) Successful in 59s
- typescript and prettier updates - FileUpload component with dark mode and dragable uploads - comment FontFamily in tailwind.config.js
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import {
|
|
column,
|
|
BaseModel,
|
|
SnakeCaseNamingStrategy,
|
|
// computed,
|
|
manyToMany,
|
|
ManyToMany,
|
|
} from '@ioc:Adonis/Lucid/Orm';
|
|
import { DateTime } from 'luxon';
|
|
import Person from './Person';
|
|
|
|
|
|
export default class Dataset extends BaseModel {
|
|
public static namingStrategy = new SnakeCaseNamingStrategy();
|
|
public static primaryKey = 'id';
|
|
public static table = 'documents';
|
|
public static selfAssignPrimaryKey = false;
|
|
|
|
@column({ isPrimary: true })
|
|
public id: number;
|
|
|
|
@column({})
|
|
public server_state: boolean;
|
|
|
|
@column({})
|
|
public publisherName: string;
|
|
|
|
@column.dateTime({ columnName: 'embargo_date' })
|
|
public embargoDate: DateTime;
|
|
|
|
@column({})
|
|
public type: string;
|
|
|
|
|
|
@column.dateTime({ columnName: 'server_date_published' })
|
|
public serverDatePublished: DateTime;
|
|
|
|
@column.dateTime({ autoCreate: true, columnName: 'created_at' })
|
|
public createdAt: DateTime;
|
|
|
|
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
public updatedAt: DateTime;
|
|
|
|
@manyToMany(() => Person, {
|
|
pivotForeignKey: 'document_id',
|
|
pivotRelatedForeignKey: 'person_id',
|
|
pivotTable: 'link_documents_persons',
|
|
pivotColumns: ['role', 'sort_order', 'allow_email_contact']
|
|
})
|
|
public persons: ManyToMany<typeof Person>;
|
|
|
|
}
|