Skip to content

Progress bar on home page with reading data from model#105

Open
marekrubik wants to merge 3 commits into
Learn-by-doing:masterfrom
marekrubik:progress_bar
Open

Progress bar on home page with reading data from model#105
marekrubik wants to merge 3 commits into
Learn-by-doing:masterfrom
marekrubik:progress_bar

Conversation

@marekrubik

Copy link
Copy Markdown

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

chill117 commented Jan 17, 2017

Copy link
Copy Markdown
Member

@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