ESLint autofixes
parent
abba82ad07
commit
ccae979451
@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: function createUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("composite_unique_constraint_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email");
|
||||
table.text("username");
|
||||
table.text("name");
|
||||
table.unique(["email", "username"]);
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("composite_unique_constraint_violation").catch(errorHandler);
|
||||
}
|
||||
up: function createUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("composite_unique_constraint_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email");
|
||||
table.text("username");
|
||||
table.text("name");
|
||||
table.unique(["email", "username"]);
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("composite_unique_constraint_violation").catch(errorHandler);
|
||||
}
|
||||
};
|
||||
|
@ -1,15 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: function createInvalidTypeTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("invalid_type", (table) => {
|
||||
table.increments("id");
|
||||
table.integer("age");
|
||||
table.text("name");
|
||||
table.boolean("active");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropInvalidTypeTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("invalid_type").catch(errorHandler);
|
||||
}
|
||||
up: function createInvalidTypeTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("invalid_type", (table) => {
|
||||
table.increments("id");
|
||||
table.integer("age");
|
||||
table.text("name");
|
||||
table.boolean("active");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropInvalidTypeTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("invalid_type").catch(errorHandler);
|
||||
}
|
||||
};
|
||||
|
@ -1,14 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: function createNotNullConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("not_null_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email").notNull();
|
||||
table.text("name");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropNotNullConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("not_null_violation").catch(errorHandler);
|
||||
}
|
||||
up: function createNotNullConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("not_null_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email").notNull();
|
||||
table.text("name");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropNotNullConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("not_null_violation").catch(errorHandler);
|
||||
}
|
||||
};
|
||||
|
@ -1,14 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: function createUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("unique_constraint_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email").unique();
|
||||
table.text("name");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("unique_constraint_violation").catch(errorHandler);
|
||||
}
|
||||
up: function createUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.createTable("unique_constraint_violation", (table) => {
|
||||
table.increments("id");
|
||||
table.text("email").unique();
|
||||
table.text("name");
|
||||
}).catch(errorHandler);
|
||||
},
|
||||
down: function dropUniqueConstraintViolationTable(knex, errorHandler) {
|
||||
return knex.schema.dropTable("unique_constraint_violation").catch(errorHandler);
|
||||
}
|
||||
};
|
||||
|
@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptCheckConstraintViolation(knex) {
|
||||
return knex("check_constraint_violation").insert([{
|
||||
number_value: "one",
|
||||
name: "Joe"
|
||||
}, {
|
||||
number_value: "four",
|
||||
name: "Jane"
|
||||
}]).returning("*");
|
||||
return knex("check_constraint_violation").insert([{
|
||||
number_value: "one",
|
||||
name: "Joe"
|
||||
}, {
|
||||
number_value: "four",
|
||||
name: "Jane"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,21 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptCompositeUniqueConstraintViolation(knex) {
|
||||
return knex("composite_unique_constraint_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
username: "foo",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com",
|
||||
username: "bar",
|
||||
name: "Jane"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
username: "baz",
|
||||
name: "Pete"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
username: "foo",
|
||||
name: "Jill"
|
||||
}]).returning("*");
|
||||
return knex("composite_unique_constraint_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
username: "foo",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com",
|
||||
username: "bar",
|
||||
name: "Jane"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
username: "baz",
|
||||
name: "Pete"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
username: "foo",
|
||||
name: "Jill"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptEnumViolation(knex) {
|
||||
return knex("enum_violation").insert([{
|
||||
number_value: "one",
|
||||
name: "Joe"
|
||||
}, {
|
||||
number_value: "four",
|
||||
name: "Jane"
|
||||
}]).returning("*");
|
||||
return knex("enum_violation").insert([{
|
||||
number_value: "one",
|
||||
name: "Joe"
|
||||
}, {
|
||||
number_value: "four",
|
||||
name: "Jane"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptInvalidTypeBooleanInverse(knex) {
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: true,
|
||||
age: 24,
|
||||
active: false
|
||||
}]).returning("*");
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: true,
|
||||
age: 24,
|
||||
active: false
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptInvalidTypeBoolean(knex) {
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: "Pete",
|
||||
age: 24,
|
||||
active: "foo bar"
|
||||
}]).returning("*");
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: "Pete",
|
||||
age: 24,
|
||||
active: "foo bar"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptInvalidTypeInteger(knex) {
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: "Pete",
|
||||
age: "twenty-four",
|
||||
active: false
|
||||
}]).returning("*");
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true
|
||||
}, {
|
||||
name: "Jane",
|
||||
age: 42,
|
||||
active: true
|
||||
}, {
|
||||
name: "Pete",
|
||||
age: "twenty-four",
|
||||
active: false
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptNotNullConstraintViolation(knex) {
|
||||
return knex("not_null_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com"
|
||||
}, {
|
||||
name: "Pete"
|
||||
}]).returning("*");
|
||||
return knex("not_null_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com"
|
||||
}, {
|
||||
name: "Pete"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptUndefinedColumn(knex) {
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true,
|
||||
nonexistentColumn: "Hello!"
|
||||
}]).returning("*");
|
||||
return knex("invalid_type").insert([{
|
||||
name: "Joe",
|
||||
age: 29,
|
||||
active: true,
|
||||
nonexistentColumn: "Hello!"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
@ -1,14 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function attemptUniqueConstraintViolation(knex) {
|
||||
return knex("unique_constraint_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com",
|
||||
name: "Jane"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
name: "Pete"
|
||||
}]).returning("*");
|
||||
return knex("unique_constraint_violation").insert([{
|
||||
email: "foo@bar.com",
|
||||
name: "Joe"
|
||||
}, {
|
||||
email: "baz@qux.com",
|
||||
name: "Jane"
|
||||
}, {
|
||||
email: "foo@bar.com",
|
||||
name: "Pete"
|
||||
}]).returning("*");
|
||||
};
|
||||
|
Loading…
Reference in New Issue