Skip to content

Instantly share code, notes, and snippets.

@championswimmer
Last active January 19, 2018 22:52
Show Gist options
  • Save championswimmer/5f2d8dd0a5f72e2b8bfaa1bd84a53dcb to your computer and use it in GitHub Desktop.
Save championswimmer/5f2d8dd0a5f72e2b8bfaa1bd84a53dcb to your computer and use it in GitHub Desktop.
#set($fileName = $NAME.substring(0,1).toLowerCase() + $NAME.substring(1))
import {DataTypeAbstract, DefineAttributeColumnOptions, DefineAttributes, Instance, Model} from 'sequelize'
import * as Sequelize from 'sequelize'
export interface ${NAME}Attributes {
id: number
}
type ${NAME}DefineAttributes = {
[x in keyof ${NAME}Attributes]: string | DataTypeAbstract | DefineAttributeColumnOptions
}
export const ${fileName}Attrs: ${NAME}DefineAttributes = {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
}
}
export interface ${NAME}Instance extends Instance<${NAME}Attributes> {
get(): ${NAME}Attributes
}
export interface ${NAME} extends Model<${NAME}Instance, ${NAME}Attributes> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment