forked from geolba/tethys.backend
initial commit
This commit is contained in:
commit
4fc3bb0a01
202 changed files with 41729 additions and 0 deletions
41
app/Models/HashValue.ts
Normal file
41
app/Models/HashValue.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
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'
|
||||
// }
|
||||
|
||||
static get incrementing () {
|
||||
return false
|
||||
}
|
||||
|
||||
// @column({
|
||||
// isPrimary: true,
|
||||
// })
|
||||
// public id: number;
|
||||
|
||||
// Foreign key is still on the same model
|
||||
@column({})
|
||||
public file_id: number;
|
||||
|
||||
@column({})
|
||||
public type: string;
|
||||
|
||||
@column()
|
||||
public value: string;
|
||||
|
||||
@belongsTo(() => File)
|
||||
public file: BelongsTo<typeof File>
|
||||
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue