forked from geolba/tethys.backend
- added new class CollectionRole.ts
- added relation 'collectionRole' to Collection.ts class - added 'ListSets' and =GetRecord request for OaiController.ts - npm updates - added utility-functions.ts
This commit is contained in:
parent
ebb24cc75c
commit
2a7480d2ed
9 changed files with 349 additions and 91 deletions
38
app/Models/CollectionRole.ts
Normal file
38
app/Models/CollectionRole.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { column, SnakeCaseNamingStrategy, hasMany, HasMany } from '@ioc:Adonis/Lucid/Orm';
|
||||
import BaseModel from './BaseModel';
|
||||
import Collection from './Collection';
|
||||
|
||||
export default class CollectionRole extends BaseModel {
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
public static primaryKey = 'id';
|
||||
public static table = 'collections_roles';
|
||||
public static fillable: string[] = ['name', 'oai_name', 'visible'];
|
||||
|
||||
@column({
|
||||
isPrimary: true,
|
||||
})
|
||||
public id: number;
|
||||
|
||||
@column({})
|
||||
public name: string;
|
||||
|
||||
@column({})
|
||||
public oai_name?: string;
|
||||
|
||||
@column({})
|
||||
public position: number;
|
||||
|
||||
@column({})
|
||||
public visible: boolean;
|
||||
|
||||
@column({})
|
||||
public visible_frontdoor: boolean;
|
||||
|
||||
@column({})
|
||||
public visible_oai: boolean;
|
||||
|
||||
@hasMany(() => Collection, {
|
||||
foreignKey: 'role_id',
|
||||
})
|
||||
public collections: HasMany<typeof Collection>;
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue