File tree Expand file tree Collapse file tree 4 files changed +1052
-39
lines changed Expand file tree Collapse file tree 4 files changed +1052
-39
lines changed Original file line number Diff line number Diff line change @@ -616,3 +616,37 @@ npm run updateLocalEnv
616
616
```
617
617
618
618
This will replace your ` .env.local ` file with the one that will be used in prod (simply taking ` .env.template + .env.SECRET_CONFIG ` ).
619
+
620
+ ### Populate database
621
+
622
+ > [ !WARNING]
623
+ > The ` MONGODB_URL ` used for this script will be fetched from ` .env.local ` . Make sure it's correct! The command runs directly on the database.
624
+
625
+ You can populate the database using faker data using the ` populate ` script:
626
+
627
+ ``` bash
628
+ npm run populate < flags here>
629
+ ```
630
+
631
+ At least one flag must be specified, the following flags are available:
632
+
633
+ - ` reset ` - resets the database
634
+ - ` all ` - populates all tables
635
+ - ` users ` - populates the users table
636
+ - ` settings ` - populates the settings table for existing users
637
+ - ` assistants ` - populates the assistants table for existing users
638
+ - ` conversations ` - populates the conversations table for existing users
639
+
640
+ For example, you could use it like so:
641
+
642
+ ``` bash
643
+ npm run populate reset
644
+ ```
645
+
646
+ to clear out the database. Then login in the app to create your user and run the following command:
647
+
648
+ ``` bash
649
+ npm run populate users settings assistants conversations
650
+ ```
651
+
652
+ to populate the database with fake data, including fake conversations and assistants for your user.
You can’t perform that action at this time.
0 commit comments