Answers for "sequelize models(sequelize)"

0

creating model sequelize

npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string
Posted by: Guest on August-25-2021
0

sequelize mysql Object

@sequelize.AllowNull(false)
	@sequelize.Column(DataTypes.JSON)
	get personalInformation(): PersonalInformation {
		return JSON.parse(this.getDataValue('personalInformation'))
	}

	set personalInformation(val: any) {
		this.setDataValue('personalInformation', JSON.stringify(val))
	}

	@sequelize.AllowNull(false)
	@sequelize.Column(DataTypes.JSON)
	get workExperinces(): WorkExperince[] {
		return JSON.parse(this.getDataValue('workExperinces'))
	}

	set workExperinces(val: any) {
		this.setDataValue('workExperinces', JSON.stringify(val))
	}
Posted by: Guest on September-01-2021

Browse Popular Code Answers by Language