diff --git a/api/models/index.ts b/api/models/index.ts index bb8f386..18e74ae 100644 --- a/api/models/index.ts +++ b/api/models/index.ts @@ -17,7 +17,7 @@ const config = require(path.join(__dirname,'../../config/config.json'))[env] const sequelize = new Sequelize({ ...config, - logging: console.log,//process.env.SQL_LOG==='true' ? console.log : false, + logging: process.env.SQL_LOG==='true' ? console.log : false, models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember,Timer,Bot,ChatBot,BotMember] }) const models = sequelize.models diff --git a/api/models/ts/chatBot.ts b/api/models/ts/chatBot.ts index 80b595a..22d7ff8 100644 --- a/api/models/ts/chatBot.ts +++ b/api/models/ts/chatBot.ts @@ -4,7 +4,7 @@ import { Table, Column, Model } from 'sequelize-typescript'; TRIBE OWNER - bots installed as "contacts" in a tribe */ -@Table({tableName: 'sphinx_chat_members', underscored: true, indexes:[ +@Table({tableName: 'sphinx_chat_bots', underscored: true, indexes:[ {unique:true, fields:['chat_id','bot_uuid']} ]}) export default class ChatBot extends Model { diff --git a/dist/api/models/index.js b/dist/api/models/index.js index 094a33e..e879627 100644 --- a/dist/api/models/index.js +++ b/dist/api/models/index.js @@ -15,7 +15,7 @@ const chatBot_1 = require("./ts/chatBot"); const botMember_1 = require("./ts/botMember"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/config.json'))[env]; -const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: console.log, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default, bot_1.default, chatBot_1.default, botMember_1.default] })); +const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default, bot_1.default, chatBot_1.default, botMember_1.default] })); exports.sequelize = sequelize; const models = sequelize.models; exports.models = models; diff --git a/dist/api/models/index.js.map b/dist/api/models/index.js.map index 2342fe1..8a33fef 100644 --- a/dist/api/models/index.js.map +++ b/dist/api/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAC9B,kCAA0B;AAC1B,0CAAkC;AAClC,8CAAsC;AAEtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,EACpB,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,EAAC,aAAG,EAAC,iBAAO,EAAC,mBAAS,CAAC,IAClG,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAC9B,kCAA0B;AAC1B,0CAAkC;AAClC,8CAAsC;AAEtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,EAAC,aAAG,EAAC,iBAAO,EAAC,mBAAS,CAAC,IAClG,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file diff --git a/dist/api/models/ts/chatBot.js b/dist/api/models/ts/chatBot.js index 744c3bc..b25e28b 100644 --- a/dist/api/models/ts/chatBot.js +++ b/dist/api/models/ts/chatBot.js @@ -48,7 +48,7 @@ __decorate([ __metadata("design:type", Date) ], ChatBot.prototype, "updatedAt", void 0); ChatBot = __decorate([ - sequelize_typescript_1.Table({ tableName: 'sphinx_chat_members', underscored: true, indexes: [ + sequelize_typescript_1.Table({ tableName: 'sphinx_chat_bots', underscored: true, indexes: [ { unique: true, fields: ['chat_id', 'bot_uuid'] } ] }) ], ChatBot); diff --git a/dist/api/models/ts/chatBot.js.map b/dist/api/models/ts/chatBot.js.map index 1b4449f..bd6b27d 100644 --- a/dist/api/models/ts/chatBot.js.map +++ b/dist/api/models/ts/chatBot.js.map @@ -1 +1 @@ -{"version":3,"file":"chatBot.js","sourceRoot":"","sources":["../../../../api/models/ts/chatBot.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4D;AAE5D;;EAEE;AAKF,IAAqB,OAAO,GAA5B,MAAqB,OAAQ,SAAQ,4BAAc;CAyBlD,CAAA;AAtBC;IADC,6BAAM;;uCACO;AAGd;IADC,6BAAM;;wCACQ;AAGf;IADC,6BAAM;;wCACQ;AAGf;IADC,6BAAM;;0CACU;AAGjB;IADC,6BAAM;;+CACe;AAGtB;IADC,6BAAM;;qCACK;AAGZ;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;8BACI,IAAI;0CAAA;AAxBI,OAAO;IAH3B,4BAAK,CAAC,EAAC,SAAS,EAAE,qBAAqB,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAC;YACnE,EAAC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,SAAS,EAAC,UAAU,CAAC,EAAC;SAC7C,EAAC,CAAC;GACkB,OAAO,CAyB3B;kBAzBoB,OAAO"} \ No newline at end of file +{"version":3,"file":"chatBot.js","sourceRoot":"","sources":["../../../../api/models/ts/chatBot.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4D;AAE5D;;EAEE;AAKF,IAAqB,OAAO,GAA5B,MAAqB,OAAQ,SAAQ,4BAAc;CAyBlD,CAAA;AAtBC;IADC,6BAAM;;uCACO;AAGd;IADC,6BAAM;;wCACQ;AAGf;IADC,6BAAM;;wCACQ;AAGf;IADC,6BAAM;;0CACU;AAGjB;IADC,6BAAM;;+CACe;AAGtB;IADC,6BAAM;;qCACK;AAGZ;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;8BACI,IAAI;0CAAA;AAxBI,OAAO;IAH3B,4BAAK,CAAC,EAAC,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAC;YAChE,EAAC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,SAAS,EAAC,UAAU,CAAC,EAAC;SAC7C,EAAC,CAAC;GACkB,OAAO,CAyB3B;kBAzBoB,OAAO"} \ No newline at end of file