This repository has been archived on 2026-06-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
auracle-api/src/database/models/spells/Variable.ts
Alexis 4cc7c5533e Massive cleanup
Functionnal basic API calls for spells
Cleaned up some functions
Moved some files around
2021-07-30 12:24:11 +02:00

50 lines
1.2 KiB
TypeScript

import { DataTypes, Model, Optional } from "sequelize";
import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
interface VariableAttributes {
uuid: string
description: string
published: boolean
}
interface VariableCreationAttributes extends Optional<VariableAttributes, 'uuid'> { }
export class Variable extends Model<VariableAttributes, VariableCreationAttributes> implements VariableAttributes {
public readonly uuid!: string
public description!: string
public published: boolean
public readonly createdAt!: Date;
public readonly updatedAt!: Date;
}
export default () => {
Variable.init(
{
uuid: {
type: DataTypes.UUID,
unique: true,
allowNull: false,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
description: {
type: DataTypes.STRING,
allowNull: false,
},
published: {
type: DataTypes.BOOLEAN,
defaultValue: false
}
},
{
tableName: 'au_variables',
sequelize: AuracleDatabaseDriver,
}
)
}