import {Field, FieldType, Injectable, Model} from '@extollo/lib'

/**
 * GoLink Model
 * -----------------------------------
 * A shortened URL.
 */
@Injectable()
export class GoLink extends Model<GoLink> {
    protected static table = 'go_links'
    protected static key = 'go_link_id'

    @Field(FieldType.serial, 'go_link_id')
    protected id!: number

    @Field(FieldType.bool)
    public active = true

    @Field(FieldType.varchar)
    public short!: string

    @Field(FieldType.text)
    public url!: string
}
