Last active
September 6, 2020 12:04
-
-
Save julioflima/e686a8c00cec0d9be9655fdd5154f5b4 to your computer and use it in GitHub Desktop.
Migrations using Query Builder Knex.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.up = (knex) => { | |
return knex.schema.createTable('sensor', (table) => { | |
table.string('id').primary(); | |
table.bigInteger('timestamp').notNullable().primary(); | |
table.string('date').notNullable(); | |
table.string('name').notNullable(); | |
table.float('value').notNullable(); | |
}); | |
}; | |
exports.down = (knex) => { | |
return knex.schema.dropTable('sensor'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment