-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase_script.txt
More file actions
31 lines (18 loc) · 1.01 KB
/
database_script.txt
File metadata and controls
31 lines (18 loc) · 1.01 KB
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
CREATE USER mora_development_app WITH PASSWORD 'password' CREATEDB;
CREATE DATABASE mora_development OWNER 'mora_development_app';
npx sequelize model:generate --name User --attributes user_name:string,email:string,occupation:string,hashed_password:string
npx sequelize model:generate --name Question --attributes user_id:integer,title:text
npx sequelize model:generate --name Answer --attributes user_id:integer,question_id:integer,content:text
npx sequelize model:generate --name Questions_vote --attributes 'user_id:integer,question_id:integer'
npx sequelize model:generate --name Answers_vote --attributes 'user_id:integer,answer_id:integer'
,
ORDER TO UNDO SEED, AND UNDO DATABASE
npx dotenv sequelize db:seed:undo:all
npx dotenv sequelize db:migrate:undo:all
npx dotenv sequelize db:migrate
npx dotenv sequelize db:seed:all
HEROKU ORDER TO UNDO SEED, AND UNDO DATABASE
heroku run sequelize db:seed:undo:all
heroku run sequelize db:migrate:undo:all
heroku run sequelize db:migrate
heroku run sequelize db:seed:all