Skip to content

Commit

Permalink
Fix spark migration (#92)
Browse files Browse the repository at this point in the history
* Fix migration

* Fix migration
  • Loading branch information
NitayRabi authored Feb 22, 2019
1 parent 510c74b commit 1c08eaa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion db/migrations/20190215192818-migrate-from-spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async function Migrate (queryInterface) {
? 'localhost'
: 'sparkdb',
dialect: 'mysql',
logging: false
};
const communitiesConfig = {
dialect: 'mysql',
Expand All @@ -138,6 +139,7 @@ async function Migrate (queryInterface) {
database: process.env.MYSQL_DB_NAME || 'communities',
username: process.env.MYSQL_DB_USERNAME || 'root',
password: process.env.MYSQL_DB_PASSWORD,
logging: false
};
const communitiesDb = await getCommunitiesDb (communitiesConfig);
const sparkDb = await getSparkDb (sparkConfig);
Expand All @@ -160,7 +162,9 @@ async function Migrate (queryInterface) {
+members.camp_id === group.spark_id
)
);
await queryInterface.bulkInsert('GroupMembers', groupMembers);
if (groupMembers && groupMembers.length) {
await queryInterface.bulkInsert('GroupMembers', groupMembers);
}
results.success.push (result);
} catch (e) {
results.failure.push (group.spark_id);
Expand Down

0 comments on commit 1c08eaa

Please sign in to comment.