Skip to content

Conversation

@msirovy
Copy link

@msirovy msirovy commented Jan 17, 2017

Please check my sollution and give me feedback

  • changed model (models/Projects.js)
  • changed controller (controllers/home.js) to distribute variables to View
  • basic css

Questions:
Is there any command to do db migrate or sync db scheme from model to working DB?

@chill117
Copy link
Member

chill117 commented Jan 17, 2017

@msirovy The "current amount" is the current total amount of funds that have been sent to the project's receiving address (bitcoin address). This information exists in the bitcoin blockchain, which we check by using blockchain.info's API. See services/bitcoin.js.

As for database migrations:

  • The BaseModel has a function named queueSchemaChange which allows you to queue-up a change to the database. Usage looks like this:
YourModel.queueSchemaChange(function(cb) {
    db.schema.table(this.tableName, function(table) {
        table.string('new_string_column');
        // Call cb() when done with your changes.
    });
});

See knex.js for more information about how to work with its schema API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants