import { Association, CreationOptional, DataTypes, HasManyGetAssociationsMixin, HasOneCreateAssociationMixin, HasOneGetAssociationMixin, InferAttributes, InferCreationAttributes, Model, NonAttribute, Sequelize } from "@sequelize/core";
import {
    PrimaryKey,
    Attribute,
    AutoIncrement,
    NotNull,
    BelongsTo,
    Unique,
    HasMany,
    HasOne,
    UpdatedAt,
    CreatedAt,
} from '@sequelize/core/decorators-legacy';

import { SqliteDialect } from '@sequelize/sqlite3';


export class APIKey extends Model<InferAttributes<APIKey>, InferCreationAttributes<APIKey>>{
    // Attributes
    @Attribute(DataTypes.INTEGER)
    @PrimaryKey
    @AutoIncrement
    @Unique
    declare id: number;
    @Attribute(DataTypes.UUID)
    declare key: string;
    @Attribute(DataTypes.BOOLEAN)
    declare isAdminKey: boolean

    // Date thingies
    @CreatedAt
    declare createdAt: CreationOptional<Date>;
    @UpdatedAt
    declare updatedAt: CreationOptional<Date>;
    
}
