Browse Source

application table

release_1.1.2
巴林闲侠 3 years ago
parent
commit
6a01f3c757
  1. 88
      code/VideoAccess-VCMP/api/app/lib/models/application.js
  2. 2
      code/VideoAccess-VCMP/api/sequelize-automate.config.js
  3. 19
      code/VideoAccess-VCMP/script/1.2.1/schema/1.create_application.sql

88
code/VideoAccess-VCMP/api/app/lib/models/application.js

@ -0,0 +1,88 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Application = sequelize.define("application", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "application_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
type: {
type: array,
allowNull: true,
defaultValue: null,
comment: "web / app / wxapp / other",
primaryKey: false,
field: "type",
autoIncrement: false
},
appKey: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "app_key",
autoIncrement: false
},
appSecret: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "app_secret",
autoIncrement: false
},
createUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_user_id",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_time",
autoIncrement: false
},
forbidden: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "forbidden",
autoIncrement: false
}
}, {
tableName: "application",
comment: "",
indexes: []
});
dc.models.Application = Application;
return Application;
};

2
code/VideoAccess-VCMP/api/sequelize-automate.config.js

@ -26,7 +26,7 @@ module.exports = {
dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
tables: ['camera_status_offline_log'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
tables: ['application'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面

19
code/VideoAccess-VCMP/script/1.2.1/schema/1.create_application.sql

@ -0,0 +1,19 @@
create table if not exists application
(
id serial not null,
name varchar(32) not null,
type character varying[],
app_key varchar(64) not null,
app_secret varchar(64) not null,
create_user_id integer not null,
create_time timestamp not null,
forbidden boolean default false not null,
constraint application_pk
primary key (id)
);
comment on column application.type is 'web / app / wxapp / other';
create unique index if not exists application_id_uindex
on application (id);
Loading…
Cancel
Save