-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_db.sh
executable file
·39 lines (23 loc) · 1.06 KB
/
init_db.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Setting up the database
#quick trick --
# ask chatGPT to generate a migratin script for you if you have your schema already
#authorized parents table
npx sequelize-cli model:generate --name authorised_parents --attributes email:string,password:string,childsname:string,device_id:string
#children table
npx sequelize-cli model:generate --name children --attributes device_id:string,child_name:string,email:string
#location table
npx sequelize-cli model:generate --name locations --attributes device_id:string,latitude:float,longitude:float
#app details table
npx sequelize-cli model:generate --name app_details --attributes device_id:string,installed_app_name:string,app_status:string
#Seed the database tables
#app details table
npx sequelize-cli seed:generate --name app_details
#children table
npx sequelize-cli seed:generate --name children
#location table
npx sequelize-cli seed:generate --name locations
#authorized parents table
npx sequelize-cli seed:generate --name authorised_parents
#commiting all seeds created
npx sequelize-cli db:seed:all