Merge pull request #7950 from theoinglis/sequelize

Add constructor for Virtual DataType
This commit is contained in:
Masahiro Wakame
2016-02-07 01:43:00 +09:00
2 changed files with 13 additions and 1 deletions
+3
View File
@@ -581,6 +581,9 @@ Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
new Sequelize.VIRTUAL( Sequelize.STRING );
new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
//
// Deferrable
+10 -1
View File
@@ -1778,7 +1778,16 @@ declare module "sequelize" {
interface DataTypeUUIDv4 extends DataTypeAbstract { }
interface DataTypeVirtual extends DataTypeAbstract { }
interface DataTypeVirtual extends DataTypeAbstract {
/**
* Virtual field
*
* Accepts subtype any of the DataTypes
* Array of required attributes that are available on the model
*/
new( subtype : DataTypeAbstract, requireAttributes? : Array<string> ) : DataTypeVirtual;
}
interface DataTypeEnum extends DataTypeAbstract {