Buncha changes I CBA
This commit is contained in:
@@ -42,12 +42,22 @@ Auth.init({
|
||||
sequelize // passing the `sequelize` instance is required
|
||||
});
|
||||
|
||||
export type PostAttributes = {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string;
|
||||
date: number;
|
||||
user_id:ForeignKey<User['id']>;
|
||||
}
|
||||
export type PostCreationAttributes = {
|
||||
title: string;
|
||||
content: string;
|
||||
date: number;
|
||||
user_id:number;
|
||||
}
|
||||
|
||||
export class Post extends Model<InferAttributes<Post>, InferCreationAttributes<Post>> {
|
||||
declare id: number|null;
|
||||
declare title: string;
|
||||
declare content: string;
|
||||
declare date: number;
|
||||
export class Post extends Model<PostAttributes, PostCreationAttributes> {
|
||||
declare id: number;
|
||||
declare user:NonAttribute<User>;
|
||||
declare user_id:ForeignKey<User['id']>;
|
||||
declare getUser: BelongsToGetAssociationMixin<User>;
|
||||
@@ -73,6 +83,7 @@ Post.init(
|
||||
date: {
|
||||
type: DataTypes.DATE
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
tableName: 'Posts',
|
||||
|
||||
Reference in New Issue
Block a user