import {sequelize} from "../app"; import * as crypto from "crypto"; import {DataTypes, InferAttributes, InferCreationAttributes, Model} from "sequelize"; export interface IMedia extends Model, InferCreationAttributes> { assetId?: string clientId: number assetName: string assetEnding: string assetDescription?: string } const MediaSchema = sequelize.define('media', { assetId: { type: DataTypes.STRING, defaultValue: () => crypto.randomBytes(12).toString('hex') }, clientId: { type: DataTypes.BIGINT, allowNull: false }, assetName: { type: DataTypes.STRING, defaultValue: "Sheepstar Asset" }, assetDescription: { type: DataTypes.STRING, defaultValue: "Well I dont know what this is for" }, assetEnding: { type: DataTypes.STRING, defaultValue: "txt" } }); export const Media = MediaSchema;