-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VR-68: prettier and removing seeds path from knexfile.
- Loading branch information
Paulius Michelevicius
authored and
Paulius Michelevicius
committed
May 8, 2024
1 parent
4d52621
commit f7b3223
Showing
4 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
// Currently based of statuses, variants, should cover all possible scenarios within table boundries | ||
|
||
const company_name = 'Seeded company_name Name' | ||
const variants = [{ status: 'pending', company_name }, { status: 'pending', company_name: '_@@$@*@&%£*&@£*$*(@£*$)@£*&' }, { status: 'unverified', company_name: 0 }, { status: 'unverified', company_name },{ status: 'verified_them', company_name }, { status: 'verified_us', company_name }, { status: 'verified_both', company_name }, { status: 'disconnected', company_name }] | ||
const variants = [ | ||
{ status: 'pending', company_name }, | ||
{ status: 'pending', company_name: '_@@$@*@&%£*&@£*$*(@£*$)@£*&' }, | ||
{ status: 'unverified', company_name: 0 }, | ||
{ status: 'unverified', company_name }, | ||
{ status: 'verified_them', company_name }, | ||
{ status: 'verified_us', company_name }, | ||
{ status: 'verified_both', company_name }, | ||
{ status: 'disconnected', company_name }, | ||
] | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.seed = async function(knex) { | ||
exports.seed = async function (knex) { | ||
// Deletes ALL existing entries | ||
await knex('connection').del() | ||
await Promise.all(variants.map(({ status, company_name }) => knex('connection').insert([{ status, company_name}]))) | ||
await Promise.all(variants.map(({ status, company_name }) => knex('connection').insert([{ status, company_name }]))) | ||
} |
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