Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Sequelize model datatype of enum

const Person = sequelize.define('model', {
  name: {
	type: Sequelize.STRING
  },
  gender: {
    type:   Sequelize.ENUM,
    values: ['Male', 'Female', 'Others']
  },
  bloodGroup: {
    type:   Sequelize.ENUM('A', 'B', 'AB', 'O')
  }
});

console.log(Person.rawAttributes.gender.values);
// log output => ['Male', 'Female', 'Others']
console.log(Person.rawAttributes.bloodGroup.values);
// log output => ['A', 'B', 'AB', 'O']
Comment

PREVIOUS NEXT
Code Example
Sql :: sql row having max 
Sql :: what is relational database 
Sql :: return the number of records in a single table mysql 
Sql :: Add a new column into table 
Sql :: sql insert data 
Sql :: BigQuery Remove Duplicate Keys From Table 
Sql :: oracle db timestamp auto add 
Sql :: sql group by 
Sql :: select other columns with distinct 
Sql :: how to execute MySQL Stored Procedure in Python 
Sql :: SQL Server OPENQUERY WITH result SETS 
Sql :: alter table drop partition hive 
Sql :: divide by zero error in sql 
Sql :: group_concat mysql 
Sql :: sql count(*) 
Sql :: mysql sort asc numeric 
Sql :: GUI for sqlite mac 
Sql :: update join 
Sql :: mysql date time string format for marshmellow field schema 
Sql :: how to check last index rebuild sql server 
Sql :: select where mysql 
Sql :: no suitable driver found for sqlite 
Sql :: in in sql 
Sql :: mysql update from n to 100 
Sql :: how to login to mysql as normal user in ubuntu 
Sql :: greater than or equal to symbol in postgres 
Sql :: linux upload database to mysql 
Sql :: SQL Server date literal 
Sql :: what is between keyword used for 
Sql :: postgres advance table id count 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =