2016-07-10 02:11:13 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
2018-06-23 03:26:46 +00:00
|
|
|
// ENiGMA½
|
2022-06-05 20:04:25 +00:00
|
|
|
const MenuModule = require('./menu_module.js').MenuModule;
|
2017-09-16 23:24:26 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const { getModDatabasePath, getTransactionDatabase } = require('./database.js');
|
2017-09-16 23:24:26 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const ViewController = require('./view_controller.js').ViewController;
|
|
|
|
const ansi = require('./ansi_term.js');
|
|
|
|
const theme = require('./theme.js');
|
|
|
|
const User = require('./user.js');
|
|
|
|
const stringFormat = require('./string_format.js');
|
2016-07-10 02:11:13 +00:00
|
|
|
|
2018-06-23 03:26:46 +00:00
|
|
|
// deps
|
2022-06-05 20:04:25 +00:00
|
|
|
const async = require('async');
|
|
|
|
const sqlite3 = require('sqlite3');
|
|
|
|
const _ = require('lodash');
|
2016-07-10 02:11:13 +00:00
|
|
|
|
2018-06-23 03:26:46 +00:00
|
|
|
// :TODO: add notes field
|
2016-07-10 02:11:13 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const moduleInfo = (exports.moduleInfo = {
|
|
|
|
name: 'BBS List',
|
|
|
|
desc: 'List of other BBSes',
|
|
|
|
author: 'Andrew Pamment',
|
|
|
|
packageName: 'com.magickabbs.enigma.bbslist',
|
|
|
|
});
|
2016-07-10 02:11:13 +00:00
|
|
|
|
|
|
|
const MciViewIds = {
|
2022-06-05 20:04:25 +00:00
|
|
|
view: {
|
|
|
|
BBSList: 1,
|
|
|
|
SelectedBBSName: 2,
|
|
|
|
SelectedBBSSysOp: 3,
|
|
|
|
SelectedBBSTelnet: 4,
|
|
|
|
SelectedBBSWww: 5,
|
|
|
|
SelectedBBSLoc: 6,
|
|
|
|
SelectedBBSSoftware: 7,
|
|
|
|
SelectedBBSNotes: 8,
|
|
|
|
SelectedBBSSubmitter: 9,
|
|
|
|
},
|
|
|
|
add: {
|
|
|
|
BBSName: 1,
|
|
|
|
Sysop: 2,
|
|
|
|
Telnet: 3,
|
|
|
|
Www: 4,
|
|
|
|
Location: 5,
|
|
|
|
Software: 6,
|
|
|
|
Notes: 7,
|
|
|
|
Error: 8,
|
2018-06-22 05:15:04 +00:00
|
|
|
},
|
2016-07-10 02:11:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const FormIds = {
|
2022-06-05 20:04:25 +00:00
|
|
|
View: 0,
|
|
|
|
Add: 1,
|
2016-07-10 02:11:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const SELECTED_MCI_NAME_TO_ENTRY = {
|
2022-06-05 20:04:25 +00:00
|
|
|
SelectedBBSName: 'bbsName',
|
|
|
|
SelectedBBSSysOp: 'sysOp',
|
|
|
|
SelectedBBSTelnet: 'telnet',
|
|
|
|
SelectedBBSWww: 'www',
|
|
|
|
SelectedBBSLoc: 'location',
|
|
|
|
SelectedBBSSoftware: 'software',
|
|
|
|
SelectedBBSSubmitter: 'submitter',
|
|
|
|
SelectedBBSSubmitterId: 'submitterUserId',
|
|
|
|
SelectedBBSNotes: 'notes',
|
2016-07-10 02:11:13 +00:00
|
|
|
};
|
|
|
|
|
2017-01-26 05:18:05 +00:00
|
|
|
exports.getModule = class BBSListModule extends MenuModule {
|
2018-06-22 05:15:04 +00:00
|
|
|
constructor(options) {
|
|
|
|
super(options);
|
|
|
|
|
|
|
|
const self = this;
|
|
|
|
this.menuMethods = {
|
|
|
|
//
|
2018-06-23 03:26:46 +00:00
|
|
|
// Validators
|
2018-06-22 05:15:04 +00:00
|
|
|
//
|
2022-06-05 20:04:25 +00:00
|
|
|
viewValidationListener: function (err, cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
const errMsgView = self.viewControllers.add.getView(MciViewIds.add.Error);
|
2022-06-05 20:04:25 +00:00
|
|
|
if (errMsgView) {
|
|
|
|
if (err) {
|
2023-02-04 20:44:55 +00:00
|
|
|
errMsgView.setText(err.friendlyText);
|
2018-06-22 05:15:04 +00:00
|
|
|
} else {
|
|
|
|
errMsgView.clearText();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-04 20:44:55 +00:00
|
|
|
return cb(err, null);
|
2018-06-22 05:15:04 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
//
|
2018-06-23 03:26:46 +00:00
|
|
|
// Key & submit handlers
|
2018-06-22 05:15:04 +00:00
|
|
|
//
|
2022-06-05 20:04:25 +00:00
|
|
|
addBBS: function (formData, extraArgs, cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
self.displayAddScreen(cb);
|
|
|
|
},
|
2022-06-05 20:04:25 +00:00
|
|
|
deleteBBS: function (formData, extraArgs, cb) {
|
|
|
|
if (!_.isNumber(self.selectedBBS) || 0 === self.entries.length) {
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(null);
|
|
|
|
}
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
const entriesView = self.viewControllers.view.getView(
|
|
|
|
MciViewIds.view.BBSList
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
if (
|
|
|
|
self.entries[self.selectedBBS].submitterUserId !==
|
|
|
|
self.client.user.userId &&
|
|
|
|
!self.client.user.isSysOp()
|
|
|
|
) {
|
2018-06-23 03:26:46 +00:00
|
|
|
// must be owner or +op
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
const entry = self.entries[self.selectedBBS];
|
2022-06-05 20:04:25 +00:00
|
|
|
if (!entry) {
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
self.database.run(
|
2023-02-04 20:44:55 +00:00
|
|
|
`DELETE FROM bbs_list
|
2018-06-23 03:26:46 +00:00
|
|
|
WHERE id=?;`,
|
2022-06-05 20:04:25 +00:00
|
|
|
[entry.id],
|
2018-06-22 05:15:04 +00:00
|
|
|
err => {
|
|
|
|
if (err) {
|
2022-06-05 20:04:25 +00:00
|
|
|
self.client.log.error(
|
|
|
|
{ err: err },
|
|
|
|
'Error deleting from BBS list'
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
} else {
|
|
|
|
self.entries.splice(self.selectedBBS, 1);
|
|
|
|
|
|
|
|
self.setEntries(entriesView);
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
if (self.entries.length > 0) {
|
2018-06-22 05:15:04 +00:00
|
|
|
entriesView.focusPrevious();
|
|
|
|
}
|
|
|
|
|
|
|
|
self.viewControllers.view.redrawAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
return cb(null);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
2022-06-05 20:04:25 +00:00
|
|
|
submitBBS: function (formData, extraArgs, cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
let ok = true;
|
2022-06-05 20:04:25 +00:00
|
|
|
['BBSName', 'Sysop', 'Telnet'].forEach(mciName => {
|
|
|
|
if (
|
|
|
|
'' ===
|
|
|
|
self.viewControllers.add
|
|
|
|
.getView(MciViewIds.add[mciName])
|
|
|
|
.getData()
|
|
|
|
) {
|
2018-06-22 05:15:04 +00:00
|
|
|
ok = false;
|
|
|
|
}
|
|
|
|
});
|
2022-06-05 20:04:25 +00:00
|
|
|
if (!ok) {
|
2018-06-23 03:26:46 +00:00
|
|
|
// validators should prevent this!
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
self.database.run(
|
2023-02-04 20:44:55 +00:00
|
|
|
`INSERT INTO bbs_list (bbs_name, sysop, telnet, www, location, software, submitter_user_id, notes)
|
2018-06-23 03:26:46 +00:00
|
|
|
VALUES(?, ?, ?, ?, ?, ?, ?, ?);`,
|
2018-06-22 05:15:04 +00:00
|
|
|
[
|
2022-06-05 20:04:25 +00:00
|
|
|
formData.value.name,
|
|
|
|
formData.value.sysop,
|
|
|
|
formData.value.telnet,
|
|
|
|
formData.value.www,
|
|
|
|
formData.value.location,
|
|
|
|
formData.value.software,
|
|
|
|
self.client.user.userId,
|
|
|
|
formData.value.notes,
|
2018-06-22 05:15:04 +00:00
|
|
|
],
|
|
|
|
err => {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (err) {
|
|
|
|
self.client.log.error(
|
|
|
|
{ err: err },
|
|
|
|
'Error adding to BBS list'
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
self.clearAddForm();
|
|
|
|
self.displayBBSList(true, cb);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
2022-06-05 20:04:25 +00:00
|
|
|
cancelSubmit: function (formData, extraArgs, cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
self.clearAddForm();
|
|
|
|
self.displayBBSList(true, cb);
|
2022-06-05 20:04:25 +00:00
|
|
|
},
|
2018-06-22 05:15:04 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
initSequence() {
|
|
|
|
const self = this;
|
|
|
|
async.series(
|
|
|
|
[
|
|
|
|
function beforeDisplayArt(callback) {
|
|
|
|
self.beforeArt(callback);
|
|
|
|
},
|
|
|
|
function display(callback) {
|
|
|
|
self.displayBBSList(false, callback);
|
2022-06-05 20:04:25 +00:00
|
|
|
},
|
2018-06-22 05:15:04 +00:00
|
|
|
],
|
|
|
|
err => {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (err) {
|
2018-06-23 03:26:46 +00:00
|
|
|
// :TODO: Handle me -- initSequence() should really take a completion callback
|
2018-06-22 05:15:04 +00:00
|
|
|
}
|
|
|
|
self.finishedLoading();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
drawSelectedEntry(entry) {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (!entry) {
|
2018-06-22 05:15:04 +00:00
|
|
|
Object.keys(SELECTED_MCI_NAME_TO_ENTRY).forEach(mciName => {
|
|
|
|
this.setViewText('view', MciViewIds.view[mciName], '');
|
|
|
|
});
|
|
|
|
} else {
|
2022-06-05 20:04:25 +00:00
|
|
|
const youSubmittedFormat =
|
|
|
|
this.menuConfig.youSubmittedFormat || '{submitter} (You!)';
|
2018-06-22 05:15:04 +00:00
|
|
|
|
|
|
|
Object.keys(SELECTED_MCI_NAME_TO_ENTRY).forEach(mciName => {
|
|
|
|
const t = entry[SELECTED_MCI_NAME_TO_ENTRY[mciName]];
|
2022-06-05 20:04:25 +00:00
|
|
|
if (MciViewIds.view[mciName]) {
|
|
|
|
if (
|
|
|
|
'SelectedBBSSubmitter' == mciName &&
|
|
|
|
entry.submitterUserId == this.client.user.userId
|
|
|
|
) {
|
|
|
|
this.setViewText(
|
|
|
|
'view',
|
|
|
|
MciViewIds.view.SelectedBBSSubmitter,
|
|
|
|
stringFormat(youSubmittedFormat, entry)
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
} else {
|
2022-06-05 20:04:25 +00:00
|
|
|
this.setViewText('view', MciViewIds.view[mciName], t);
|
2018-06-22 05:15:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setEntries(entriesView) {
|
2018-11-06 04:08:56 +00:00
|
|
|
return entriesView.setItems(this.entries);
|
2018-06-22 05:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
displayBBSList(clearScreen, cb) {
|
|
|
|
const self = this;
|
|
|
|
|
|
|
|
async.waterfall(
|
|
|
|
[
|
|
|
|
function clearAndDisplayArt(callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (self.viewControllers.add) {
|
2018-06-22 05:15:04 +00:00
|
|
|
self.viewControllers.add.setFocus(false);
|
|
|
|
}
|
|
|
|
if (clearScreen) {
|
|
|
|
self.client.term.rawWrite(ansi.resetScreen());
|
|
|
|
}
|
|
|
|
theme.displayThemedAsset(
|
|
|
|
self.menuConfig.config.art.entries,
|
|
|
|
self.client,
|
2022-06-05 20:04:25 +00:00
|
|
|
{ font: self.menuConfig.font, trailingLF: false },
|
2018-06-22 05:15:04 +00:00
|
|
|
(err, artData) => {
|
|
|
|
return callback(err, artData);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
|
|
|
function initOrRedrawViewController(artData, callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (_.isUndefined(self.viewControllers.add)) {
|
2018-06-22 05:15:04 +00:00
|
|
|
const vc = self.addViewController(
|
|
|
|
'view',
|
2022-06-05 20:04:25 +00:00
|
|
|
new ViewController({
|
|
|
|
client: self.client,
|
|
|
|
formId: FormIds.View,
|
|
|
|
})
|
2018-06-22 05:15:04 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const loadOpts = {
|
2022-06-05 20:04:25 +00:00
|
|
|
callingMenu: self,
|
|
|
|
mciMap: artData.mciMap,
|
|
|
|
formId: FormIds.View,
|
2018-06-22 05:15:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return vc.loadFromMenuConfig(loadOpts, callback);
|
|
|
|
} else {
|
|
|
|
self.viewControllers.view.setFocus(true);
|
2022-06-05 20:04:25 +00:00
|
|
|
self.viewControllers.view
|
|
|
|
.getView(MciViewIds.view.BBSList)
|
|
|
|
.redraw();
|
2018-06-22 05:15:04 +00:00
|
|
|
return callback(null);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function fetchEntries(callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
const entriesView = self.viewControllers.view.getView(
|
|
|
|
MciViewIds.view.BBSList
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
self.entries = [];
|
|
|
|
|
|
|
|
self.database.each(
|
|
|
|
`SELECT id, bbs_name, sysop, telnet, www, location, software, submitter_user_id, notes
|
2018-06-23 03:26:46 +00:00
|
|
|
FROM bbs_list;`,
|
2018-06-22 05:15:04 +00:00
|
|
|
(err, row) => {
|
|
|
|
if (!err) {
|
|
|
|
self.entries.push({
|
2022-06-05 20:04:25 +00:00
|
|
|
text: row.bbs_name, // standard field
|
|
|
|
id: row.id,
|
|
|
|
bbsName: row.bbs_name,
|
|
|
|
sysOp: row.sysop,
|
|
|
|
telnet: row.telnet,
|
|
|
|
www: row.www,
|
|
|
|
location: row.location,
|
|
|
|
software: row.software,
|
|
|
|
submitterUserId: row.submitter_user_id,
|
|
|
|
notes: row.notes,
|
2018-06-22 05:15:04 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
err => {
|
|
|
|
return callback(err, entriesView);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
|
|
|
function getUserNames(entriesView, callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
async.each(
|
|
|
|
self.entries,
|
|
|
|
(entry, next) => {
|
|
|
|
User.getUserName(entry.submitterUserId, (err, username) => {
|
|
|
|
if (username) {
|
|
|
|
entry.submitter = username;
|
|
|
|
} else {
|
|
|
|
entry.submitter = 'N/A';
|
|
|
|
}
|
|
|
|
return next();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
() => {
|
|
|
|
return callback(null, entriesView);
|
|
|
|
}
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
},
|
|
|
|
function populateEntries(entriesView, callback) {
|
|
|
|
self.setEntries(entriesView);
|
|
|
|
|
|
|
|
entriesView.on('index update', idx => {
|
|
|
|
const entry = self.entries[idx];
|
|
|
|
|
|
|
|
self.drawSelectedEntry(entry);
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
if (!entry) {
|
2018-06-22 05:15:04 +00:00
|
|
|
self.selectedBBS = -1;
|
|
|
|
} else {
|
|
|
|
self.selectedBBS = idx;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (self.selectedBBS >= 0) {
|
|
|
|
entriesView.setFocusItemIndex(self.selectedBBS);
|
|
|
|
self.drawSelectedEntry(self.entries[self.selectedBBS]);
|
|
|
|
} else if (self.entries.length > 0) {
|
|
|
|
self.selectedBBS = 0;
|
|
|
|
entriesView.setFocusItemIndex(0);
|
|
|
|
self.drawSelectedEntry(self.entries[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
entriesView.redraw();
|
|
|
|
|
|
|
|
return callback(null);
|
2022-06-05 20:04:25 +00:00
|
|
|
},
|
2018-06-22 05:15:04 +00:00
|
|
|
],
|
|
|
|
err => {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
displayAddScreen(cb) {
|
|
|
|
const self = this;
|
|
|
|
|
|
|
|
async.waterfall(
|
|
|
|
[
|
|
|
|
function clearAndDisplayArt(callback) {
|
|
|
|
self.viewControllers.view.setFocus(false);
|
|
|
|
self.client.term.rawWrite(ansi.resetScreen());
|
|
|
|
|
|
|
|
theme.displayThemedAsset(
|
|
|
|
self.menuConfig.config.art.add,
|
|
|
|
self.client,
|
2022-06-05 20:04:25 +00:00
|
|
|
{ font: self.menuConfig.font },
|
2018-06-22 05:15:04 +00:00
|
|
|
(err, artData) => {
|
|
|
|
return callback(err, artData);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
|
|
|
function initOrRedrawViewController(artData, callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (_.isUndefined(self.viewControllers.add)) {
|
2018-06-22 05:15:04 +00:00
|
|
|
const vc = self.addViewController(
|
|
|
|
'add',
|
2022-06-05 20:04:25 +00:00
|
|
|
new ViewController({
|
|
|
|
client: self.client,
|
|
|
|
formId: FormIds.Add,
|
|
|
|
})
|
2018-06-22 05:15:04 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const loadOpts = {
|
2022-06-05 20:04:25 +00:00
|
|
|
callingMenu: self,
|
|
|
|
mciMap: artData.mciMap,
|
|
|
|
formId: FormIds.Add,
|
2018-06-22 05:15:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return vc.loadFromMenuConfig(loadOpts, callback);
|
|
|
|
} else {
|
|
|
|
self.viewControllers.add.setFocus(true);
|
|
|
|
self.viewControllers.add.redrawAll();
|
|
|
|
self.viewControllers.add.switchFocus(MciViewIds.add.BBSName);
|
|
|
|
return callback(null);
|
|
|
|
}
|
2022-06-05 20:04:25 +00:00
|
|
|
},
|
2018-06-22 05:15:04 +00:00
|
|
|
],
|
|
|
|
err => {
|
2022-06-05 20:04:25 +00:00
|
|
|
if (cb) {
|
2018-06-22 05:15:04 +00:00
|
|
|
return cb(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
clearAddForm() {
|
2022-06-05 20:04:25 +00:00
|
|
|
[
|
|
|
|
'BBSName',
|
|
|
|
'Sysop',
|
|
|
|
'Telnet',
|
|
|
|
'Www',
|
|
|
|
'Location',
|
|
|
|
'Software',
|
|
|
|
'Error',
|
|
|
|
'Notes',
|
|
|
|
].forEach(mciName => {
|
2018-06-22 05:15:04 +00:00
|
|
|
this.setViewText('add', MciViewIds.add[mciName], '');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
initDatabase(cb) {
|
|
|
|
const self = this;
|
|
|
|
|
|
|
|
async.series(
|
|
|
|
[
|
|
|
|
function openDatabase(callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
self.database = getTransactionDatabase(
|
|
|
|
new sqlite3.Database(getModDatabasePath(moduleInfo), callback)
|
|
|
|
);
|
2018-06-22 05:15:04 +00:00
|
|
|
},
|
|
|
|
function createTables(callback) {
|
2022-06-05 20:04:25 +00:00
|
|
|
self.database.serialize(() => {
|
2018-06-22 05:15:04 +00:00
|
|
|
self.database.run(
|
|
|
|
`CREATE TABLE IF NOT EXISTS bbs_list (
|
2018-06-23 03:26:46 +00:00
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
bbs_name VARCHAR NOT NULL,
|
|
|
|
sysop VARCHAR NOT NULL,
|
|
|
|
telnet VARCHAR NOT NULL,
|
|
|
|
www VARCHAR,
|
|
|
|
location VARCHAR,
|
|
|
|
software VARCHAR,
|
|
|
|
submitter_user_id INTEGER NOT NULL,
|
|
|
|
notes VARCHAR
|
|
|
|
);`
|
2018-06-22 05:15:04 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
callback(null);
|
2022-06-05 20:04:25 +00:00
|
|
|
},
|
2018-06-22 05:15:04 +00:00
|
|
|
],
|
|
|
|
err => {
|
|
|
|
return cb(err);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
beforeArt(cb) {
|
|
|
|
super.beforeArt(err => {
|
|
|
|
return err ? cb(err) : this.initDatabase(cb);
|
|
|
|
});
|
|
|
|
}
|
2016-07-10 02:11:13 +00:00
|
|
|
};
|