index.js 1.9 KB
'use strict';

const shelljs = require('shelljs');
const config = require('../../config/config');

const ServerModel = require('./server');
const BuildingModel = require('./building');
const ProjectModel = require('./project');
const DeployModel = require('./deploy');
const RestartModel = require('./restart');
const DeleteRestartModel = require('./delete_restart');
const UserModel = require('./user');
const HotfixModel = require('./hotfix');
const OperationLoggerModel = require('./operation_logger');
const PageCacheModel = require('./page_cache');
const CdnCacheModel = require('./cdn_cache');
const ProductCacheModel = require('./product_cache');
const TempProductImportModel = require('./temp_product_import');
const MemcachedHostModel = require('./memcached_host');
const DegradeModel = require('./degrade');
const DegradeServerModel = require('./degrade_server');

shelljs.mkdir('-p', config.dbDir);

const Server = new ServerModel();
const Building = new BuildingModel();
const Project = new ProjectModel();
const DeployInfo = new DeployModel();
const RestartInfo = new RestartModel();
const DeleteRestartInfo = new DeleteRestartModel();
const User = new UserModel();
const Hotfix = new HotfixModel();
const OperationLogger = new OperationLoggerModel();
const PageCache = new PageCacheModel();
const CdnCache = new CdnCacheModel();
const ProductCache = new ProductCacheModel();
const TempProductImport = new TempProductImportModel();
const MemcachedHost = new MemcachedHostModel();
const Degrade = new DegradeModel();
const DegradeServer = new DegradeServerModel();

User.init();
PageCache.init();
CdnCache.init();
ProductCache.init();

Degrade.init();

module.exports = {
    Server,
    Building,
    Project,
    DeployInfo,
    User,
    Hotfix,
    OperationLogger,
    PageCache,
    CdnCache,
    ProductCache,
    TempProductImport,
    MemcachedHost,
    RestartInfo,
    DeleteRestartInfo,
    Degrade,
    DegradeServer
};