Skip to content

Commit cdceeca

Browse files
authored
feat(test_data): add script to reset and insert data in the database use for local developpement. (#1418)
1 parent d2f0db3 commit cdceeca

File tree

8 files changed

+698
-0
lines changed

8 files changed

+698
-0
lines changed

dev_local_db_test_data/README.MD

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# YAKI local data base data
2+
3+
## how to use :
4+
5+
run
6+
7+
```
8+
sh db_reset.sh
9+
```
10+
11+
Terminal indicates the progress of the script:
12+
13+
- clear the entier yaki db
14+
- create user if needed
15+
- set all table
16+
- set test data
17+
18+
Comment unwanted docker exec command in "sh db_reset.sh" script if a step isnt needed.
19+
Replace variables in the script according to your own postgres docker configuration or .sql files names if changes.
20+
21+
## window user
22+
23+
with git bash use
24+
25+
```
26+
sh db_reset_window.sh
27+
```
28+
29+
## starting data karate :
30+
31+
replace the value of the variable "CREATE_TEST_DATA" in the script "sh db_reset.sh" with the path to the karate.sql file.
32+
Thoses data are used for karate testing and have a database without data.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
drop table if exists public.declaration;
2+
drop table if exists public.teammate;
3+
drop table if exists public.captains_teams;
4+
drop table if exists public.team;
5+
drop table if exists public.team_logo;
6+
drop table if exists public.captain;
7+
drop table if exists public.customer_rights;
8+
drop table if exists public.customer;
9+
drop table if exists public.owner;
10+
drop table if exists public.verification_token;
11+
drop table if exists public.avatar;
12+
drop table if exists public.user;
13+
drop table if exists public.locations;
14+
drop table if exists public.entity_log;
15+
drop sequence if exists public.captains_teams_id_seq;
16+
drop sequence if exists public.customer_rights_id_seq;
17+
drop sequence if exists public.entity_log_id_seq;
18+
drop sequence if exists public.verification_token_id_seq;
19+
drop sequence if exists public.team_id_seq;
20+
drop sequence if exists public.captain_id_seq;
21+
drop sequence if exists public.owner_id_seq;
22+
drop sequence if exists public.customer_id_seq;
23+
drop sequence if exists public.declaration_id_seq;
24+
drop sequence if exists public.location_id_seq;
25+
drop sequence if exists public.teammate_id_seq;
26+
drop sequence if exists public.avatar_id_seq;
27+
drop sequence if exists public.user_id_seq;
28+
drop sequence if exists public.team_logo_id_seq;
29+
drop type if exists avatar_enum;

0 commit comments

Comments
 (0)