You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							128 lines
						
					
					
						
							3.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							128 lines
						
					
					
						
							3.1 KiB
						
					
					
				| /* eslint-disable*/ | |
| 'use strict'; | |
| 
 | |
| module.exports = dc => { | |
|    const DataTypes = dc.ORM; | |
|    const sequelize = dc.orm; | |
|    const Nvr = sequelize.define("nvr", { | |
|       id: { | |
|          type: DataTypes.INTEGER, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: true, | |
|          field: "id", | |
|          autoIncrement: true, | |
|          unique: "nvr_id_uindex" | |
|       }, | |
|       name: { | |
|          type: DataTypes.STRING, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: false, | |
|          field: "name", | |
|          autoIncrement: false | |
|       }, | |
|       venderId: { | |
|          type: DataTypes.INTEGER, | |
|          allowNull: true, | |
|          defaultValue: null, | |
|          comment: "设备厂家id", | |
|          primaryKey: false, | |
|          field: "vender_id", | |
|          autoIncrement: false, | |
|          references: { | |
|             key: "id", | |
|             model: "vender" | |
|          } | |
|       }, | |
|       serialNo: { | |
|          type: DataTypes.STRING, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: "设备编号", | |
|          primaryKey: false, | |
|          field: "serial_no", | |
|          autoIncrement: false | |
|       }, | |
|       regionCode: { | |
|          type: DataTypes.STRING, | |
|          allowNull: true, | |
|          defaultValue: null, | |
|          comment: "行政区码", | |
|          primaryKey: false, | |
|          field: "region_code", | |
|          autoIncrement: false | |
|       }, | |
|       longitude: { | |
|          type: DataTypes.DOUBLE, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: false, | |
|          field: "longitude", | |
|          autoIncrement: false | |
|       }, | |
|       latitude: { | |
|          type: DataTypes.DOUBLE, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: false, | |
|          field: "latitude", | |
|          autoIncrement: false | |
|       }, | |
|       createTime: { | |
|          type: DataTypes.DATE, | |
|          allowNull: false, | |
|          defaultValue: sequelize.fn('now'), | |
|          comment: "创建时间", | |
|          primaryKey: false, | |
|          field: "create_time", | |
|          autoIncrement: false | |
|       }, | |
|       channelCount: { | |
|          type: DataTypes.INTEGER, | |
|          allowNull: true, | |
|          defaultValue: null, | |
|          comment: "通道数", | |
|          primaryKey: false, | |
|          field: "channel_count", | |
|          autoIncrement: false | |
|       }, | |
|       port: { | |
|          type: DataTypes.STRING, | |
|          allowNull: true, | |
|          defaultValue: null, | |
|          comment: "端口", | |
|          primaryKey: false, | |
|          field: "port", | |
|          autoIncrement: false | |
|       }, | |
|       delete: { | |
|          type: DataTypes.BOOLEAN, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: false, | |
|          field: "delete", | |
|          autoIncrement: false | |
|       }, | |
|       createUserId: { | |
|          type: DataTypes.INTEGER, | |
|          allowNull: false, | |
|          defaultValue: null, | |
|          comment: null, | |
|          primaryKey: false, | |
|          field: "create_user_id", | |
|          autoIncrement: false | |
|       } | |
|    }, { | |
|       tableName: "nvr", | |
|       comment: "", | |
|       indexes: [] | |
|    }); | |
|    dc.models.Nvr = Nvr; | |
|    return Nvr; | |
| }; |