aboutsummaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-03-15 22:13:42 -0700
committerAdam Soltys <[email protected]>2018-03-15 22:13:42 -0700
commit869b33813e72689c053ba8505c8806129ec3c7d5 (patch)
treef3044c3aeaf23d08efd7425df83be6695f0f3715 /migrations
parent79aeed9061db8b335e60bc4bee48571e717fa637 (diff)
downloadcoinos-server-869b33813e72689c053ba8505c8806129ec3c7d5.tar.gz
coinos-server-869b33813e72689c053ba8505c8806129ec3c7d5.zip
use payments table for in and out ln and onchain payments
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20180312160019-addInvoiceRateAndCurrency.js13
-rw-r--r--migrations/20180315232457-renameInvoices.js15
-rw-r--r--migrations/20180316032817-addPaymentsAmount.js11
3 files changed, 39 insertions, 0 deletions
diff --git a/migrations/20180312160019-addInvoiceRateAndCurrency.js b/migrations/20180312160019-addInvoiceRateAndCurrency.js
new file mode 100644
index 00000000..97dbc6ea
--- /dev/null
+++ b/migrations/20180312160019-addInvoiceRateAndCurrency.js
@@ -0,0 +1,13 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ queryInterface.addColumn('invoices', 'rate', { type: Sequelize.DOUBLE })
+ return queryInterface.addColumn('invoices', 'currency', { type: Sequelize.STRING })
+ },
+
+ down: (queryInterface, Sequelize) => {
+ queryInterface.removeColumn('invoices', 'rate')
+ return queryInterface.removeColumn('invoices', 'currency')
+ }
+};
diff --git a/migrations/20180315232457-renameInvoices.js b/migrations/20180315232457-renameInvoices.js
new file mode 100644
index 00000000..9e06e56d
--- /dev/null
+++ b/migrations/20180315232457-renameInvoices.js
@@ -0,0 +1,15 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ queryInterface.renameTable('invoices', 'payments')
+ queryInterface.addColumn('payments', 'address', { type: Sequelize.INTEGER });
+ queryInterface.addColumn('payments', 'received', { type: Sequelize.BOOLEAN });
+ },
+
+ down: (queryInterface, Sequelize) => {
+ queryInterface.removeColumn('payments', 'received');
+ queryInterface.removeColumn('payments', 'address');
+ queryInterface.renameTable('payments', 'invoices')
+ }
+};
diff --git a/migrations/20180316032817-addPaymentsAmount.js b/migrations/20180316032817-addPaymentsAmount.js
new file mode 100644
index 00000000..89356ea3
--- /dev/null
+++ b/migrations/20180316032817-addPaymentsAmount.js
@@ -0,0 +1,11 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.addColumn('payments', 'amount', { type: Sequelize.DOUBLE });
+ },
+
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.removeColumn('payments', 'amount');
+ }
+};