@@ -9,18 +9,24 @@ import country from '@seeds/data/country.json';
99import organization from '@seeds/data/organization.json' ;
1010import token from '@seeds/data/token.json' ;
1111import regionType from '@seeds/data/region_type.json' ;
12- import knex , { TableNames } from 'infra/database/knex' ;
12+ import knex , {
13+ PublicTables ,
14+ SchemaNames ,
15+ WalletTables ,
16+ } from 'infra/database/knex' ;
1317
1418export default async function globalSetup ( ) {
1519 if ( process . env . SEED === 'true' ) {
16- await knex ( TableNames . Trees ) . insert ( tree ) ;
17- await knex ( 'wallet' ) . withSchema ( 'wallet' ) . insert ( wallet ) ;
18- await knex ( 'token' ) . withSchema ( 'wallet' ) . insert ( token ) ;
19- await knex ( TableNames . Species ) . insert ( species ) ;
20- await knex ( TableNames . Organizations ) . insert ( organization ) ;
21- await knex ( TableNames . Planters ) . insert ( planter ) ;
22- await knex ( TableNames . RegionType ) . insert ( regionType ) ;
23- await knex ( TableNames . Countries ) . insert ( country ) ;
20+ await knex ( PublicTables . Trees ) . insert ( tree ) ;
21+ await knex ( WalletTables . Wallet )
22+ . withSchema ( SchemaNames . Wallet )
23+ . insert ( wallet ) ;
24+ await knex ( WalletTables . Token ) . withSchema ( SchemaNames . Wallet ) . insert ( token ) ;
25+ await knex ( PublicTables . Species ) . insert ( species ) ;
26+ await knex ( PublicTables . Organizations ) . insert ( organization ) ;
27+ await knex ( PublicTables . Planters ) . insert ( planter ) ;
28+ await knex ( PublicTables . RegionType ) . insert ( regionType ) ;
29+ await knex ( PublicTables . Countries ) . insert ( country ) ;
2430 }
2531 knex . destroy ( ) ;
2632}
0 commit comments