forked from geolba/tethys.backend
- additional functionality for DatasetController.ts
- additional validation rules like 'uniqueArray' - additional Lucid models like BaseModel.ts for filling attributes, Title.ts, Description.ts - npm updates for @adonisjs/core
This commit is contained in:
parent
c4f4eff0d9
commit
e0ff71b117
44 changed files with 2002 additions and 1556 deletions
|
@ -1,54 +1,55 @@
|
|||
import { DateTime } from 'luxon';
|
||||
import {
|
||||
column,
|
||||
BaseModel,
|
||||
hasMany, HasMany,
|
||||
// manyToMany,
|
||||
// ManyToMany,
|
||||
SnakeCaseNamingStrategy,
|
||||
column,
|
||||
BaseModel,
|
||||
hasMany,
|
||||
HasMany,
|
||||
// manyToMany,
|
||||
// ManyToMany,
|
||||
SnakeCaseNamingStrategy,
|
||||
} from '@ioc:Adonis/Lucid/Orm';
|
||||
import HashValue from './HashValue';
|
||||
|
||||
export default class File extends BaseModel {
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
public static primaryKey = 'id';
|
||||
public static table = 'document_files';
|
||||
public static selfAssignPrimaryKey = false;
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
public static primaryKey = 'id';
|
||||
public static table = 'document_files';
|
||||
public static selfAssignPrimaryKey = false;
|
||||
|
||||
@column({
|
||||
isPrimary: true,
|
||||
})
|
||||
public id: number;
|
||||
@column({
|
||||
isPrimary: true,
|
||||
})
|
||||
public id: number;
|
||||
|
||||
@column({})
|
||||
public pathName: string;
|
||||
|
||||
@column()
|
||||
public label: string;
|
||||
@column({})
|
||||
public pathName: string;
|
||||
|
||||
@column()
|
||||
public comment: string;
|
||||
public label: string;
|
||||
|
||||
@column()
|
||||
public mimetype: string;
|
||||
public comment: string;
|
||||
|
||||
@column()
|
||||
public language: string;
|
||||
public mimetype: string;
|
||||
|
||||
@column()
|
||||
public fileSize: bigint;
|
||||
public language: string;
|
||||
|
||||
@column()
|
||||
public visibleInOai: boolean;
|
||||
public fileSize: bigint;
|
||||
|
||||
@column()
|
||||
public sortOrder: number;
|
||||
public visibleInOai: boolean;
|
||||
|
||||
@column()
|
||||
public sortOrder: number;
|
||||
|
||||
@column.dateTime({ autoCreate: true })
|
||||
public createdAt: DateTime;
|
||||
public createdAt: DateTime;
|
||||
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
public updatedAt: DateTime;
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
public updatedAt: DateTime;
|
||||
|
||||
// public function hashvalues()
|
||||
// {
|
||||
|
@ -58,5 +59,5 @@ export default class File extends BaseModel {
|
|||
@hasMany(() => HashValue, {
|
||||
foreignKey: 'file_id',
|
||||
})
|
||||
public hashvalues: HasMany<typeof HashValue>;
|
||||
}
|
||||
public hashvalues: HasMany<typeof HashValue>;
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue