Browse Source

0.0.3 sql脚本

dev
巴林闲侠 3 years ago
parent
commit
71a6cda5dd
  1. 19
      api/app/lib/controllers/alarm/data.js
  2. 9
      script/0.0.3/1.alert_app_alarm.sql
  3. 6
      script/0.0.3/3.alert_project_app.sql
  4. 4
      script/0.0.3/4.create_app.sql

19
api/app/lib/controllers/alarm/data.js

@ -0,0 +1,19 @@
'use strict';
async function list (ctx) {
try {
const models = ctx.fs.dc.models;
ctx.status = 20;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
list
};

9
script/0.0.3/1.alert_app_alarm.sql

@ -1,4 +1,5 @@
alter TABLE app_alarm add screenshot varchar(1024); alter TABLE app_alarm add confirm_time timestamp alter TABLE app_alarm add screenshot varchar(1024);
WITH time zone; comment alter TABLE app_alarm add confirm_time timestamp WITH time zone;
ON column app_alarm.confirm_time is '确认时间'; alter TABLE app_alarm add confirm_auto bool default false; comment comment ON column app_alarm.confirm_time is '确认时间';
ON column app_alarm.confirm_auto is '是否自动恢复'; alter TABLE app_alarm add confirm_auto bool default false;
comment ON column app_alarm.confirm_auto is '是否自动恢复';

6
script/0.0.3/3.alert_project_app.sql

@ -4,9 +4,3 @@ alter table project_app
add app_id int; add app_id int;
alter table project_app drop column url; alter table project_app drop column url;
alter table project_app drop column lock;
alter table project_app
add constraint project_app_app_id_fk
foreign key (app_id) references app;

4
script/0.0.3/4.create_app.sql

@ -10,3 +10,7 @@ create table if not exists app
create unique index if not exists app_id_uindex create unique index if not exists app_id_uindex
on app (id); on app (id);
alter table project_app
add constraint project_app_app_id_fk
foreign key (app_id) references app;
Loading…
Cancel
Save