6 changed files with 112 additions and 5 deletions
			
			
		| @ -0,0 +1,35 @@ | |||||
|  | /* eslint-disable*/ | ||||
|  | 'use strict'; | ||||
|  | 
 | ||||
|  | module.exports = dc => { | ||||
|  |   const DataTypes = dc.ORM; | ||||
|  |   const sequelize = dc.orm; | ||||
|  |   const DeviceModel = sequelize.define("deviceModel", { | ||||
|  |     id: { | ||||
|  |       type: DataTypes.INTEGER, | ||||
|  |       allowNull: false, | ||||
|  |       defaultValue: null, | ||||
|  |       comment: null, | ||||
|  |       primaryKey: true, | ||||
|  |       field: "id", | ||||
|  |       autoIncrement: true, | ||||
|  |       unique: "device_model_pk" | ||||
|  |     }, | ||||
|  |     modelName: { | ||||
|  |       type: DataTypes.STRING, | ||||
|  |       allowNull: false, | ||||
|  |       defaultValue: null, | ||||
|  |       comment: null, | ||||
|  |       primaryKey: false, | ||||
|  |       field: "model_name", | ||||
|  |       autoIncrement: false | ||||
|  |     }, | ||||
|  |     | ||||
|  |   }, { | ||||
|  |     tableName: "device_model", | ||||
|  |     comment: "", | ||||
|  |     indexes: [] | ||||
|  |   }); | ||||
|  |   dc.models.DeviceModel = DeviceModel; | ||||
|  |   return DeviceModel; | ||||
|  | }; | ||||
| @ -0,0 +1,39 @@ | |||||
|  | 
 | ||||
|  | insert into device_model ( model_name) | ||||
|  | values  ('FS-iZD08pro'), | ||||
|  |         ('FS-YTSW'), | ||||
|  |         ('FS-YTDZ-GD'), | ||||
|  |         ('FS-iFWL-ZXSJ'), | ||||
|  |         ('ZSJ-iVW08'), | ||||
|  |         ('FS-Q90-NHB1-HC'), | ||||
|  |         ('FS-RTU-P4-SL'), | ||||
|  |         ('FS-RTU-SL'), | ||||
|  |         ('FS-V08'), | ||||
|  |         ( 'FS-M24'), | ||||
|  |         ( 'FS-LPWAN08'), | ||||
|  |         ( 'FS-RTU-SL'), | ||||
|  |         ( 'FS-RTU-P4-SL') | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | 
 | ||||
| @ -0,0 +1,12 @@ | |||||
|  | 
 | ||||
|  | create table device_model | ||||
|  | ( | ||||
|  |     id         serial | ||||
|  |         constraint device_model_pk | ||||
|  |             primary key, | ||||
|  |     model_name text | ||||
|  | ); | ||||
|  | 
 | ||||
|  | comment on table device_model is '设备类型表'; | ||||
|  | 
 | ||||
|  | comment on column device_model.model_name is '类型名字'; | ||||
					Loading…
					
					
				
		Reference in new issue