3 changed files with 108 additions and 1 deletions
@ -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; |
||||
|
}; |
@ -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…
Reference in new issue