aboutsummaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20180206033508-create-transaction.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/migrations/20180206033508-create-transaction.js b/migrations/20180206033508-create-transaction.js
new file mode 100644
index 00000000..06863a43
--- /dev/null
+++ b/migrations/20180206033508-create-transaction.js
@@ -0,0 +1,39 @@
+'use strict';
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.createTable('transactions', {
+ id: {
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: Sequelize.INTEGER
+ },
+ hash: {
+ type: Sequelize.STRING
+ },
+ address: {
+ type: Sequelize.STRING
+ },
+ date: {
+ type: Sequelize.DATE
+ },
+ amount: {
+ type: Sequelize.FLOAT
+ },
+ rate: {
+ type: Sequelize.FLOAT
+ },
+ createdAt: {
+ allowNull: false,
+ type: Sequelize.DATE
+ },
+ updatedAt: {
+ allowNull: false,
+ type: Sequelize.DATE
+ }
+ });
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.dropTable('transactions');
+ }
+};