Migrate models to TypeScript

Co-authored-by: David Mehren <dmehren1@gmail.com>
Co-authored-by: Yannick Bungers <git@innay.de>
Co-authored-by: Philipp Hochkamp <me@phochkamp.de>
Co-authored-by: nzbr <mail@nzbr.de>

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-10 22:06:12 +02:00
parent 54cd556f2f
commit 1d4107fe90
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
13 changed files with 565 additions and 539 deletions

13
lib/models/temp.ts Normal file
View file

@ -0,0 +1,13 @@
import { DataType, Model, Table, PrimaryKey, Column, Default } from 'sequelize-typescript'
import { generate as shortIdGenerate, isValid as shortIdIsValid } from "shortid";
@Table
export class Temp extends Model<Temp> {
@Default(shortIdGenerate)
@PrimaryKey
@Column(DataType.STRING)
id: string;
@Column(DataType.TEXT)
data: string
}