We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3d1dcb commit 9784940Copy full SHA for 9784940
1 file changed
scripts/e2e/database/migrations/20211126141343_create_posts_table.js
@@ -1,20 +1,9 @@
1
-const { Knex } = require('knex');
2
-
3
-/** @param {Knex} knex */
4
exports.up = (knex) => {
5
- knex.schema.hasTable('posts')
6
- .then((exists) => {
7
- if (!exists) {
8
- return knex.schema.createTable('posts', (table) => {
9
- table.increments('id').primary();
10
- table.string('body');
11
- table.timestamps(true, true);
12
- });
13
- }
14
- })
15
- .catch((error) => {
16
- console.error('Error checking for posts table:', error);
17
+ return knex.schema.createTable('posts', (table) => {
+ table.increments('id').primary();
+ table.string('body');
+ table.timestamps(true, true);
+ });
18
};
19
20
exports.down = (knex) => knex.schema.dropTable('posts');
0 commit comments