41 lines
No EOL
880 B
Markdown
41 lines
No EOL
880 B
Markdown
|
|
examples -
|
|
|
|
POST localhost:3000/resolve-address
|
|
{
|
|
"searchTerm": "38%20Upper%20Montagu%20Street%2C%20London%20W1H%201LJ%2C%20United%20Kingdom"
|
|
}
|
|
|
|
|
|
|
|
install pg MacOS -
|
|
Install Homebrew -
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
|
|
Install Postgres -
|
|
brew install postgresql
|
|
|
|
Start Postgres -
|
|
brew services start postgresql
|
|
|
|
Postgres CLI -
|
|
psql postgres
|
|
|
|
init POSTGRES Database -
|
|
CREATE DATABASE drop_shopping;
|
|
|
|
create tables -
|
|
CREATE TABLE deliveries (
|
|
id SERIAL PRIMARY KEY,
|
|
user_id INTEGER NOT NULL,
|
|
slot_id INTEGER NOT NULL,
|
|
delivery_date DATE NOT NULL,
|
|
address TEXT NOT NULL,
|
|
status VARCHAR(10) NOT NULL
|
|
);
|
|
|
|
|
|
knex for migration files
|
|
npx knex migrate:make create_addresses_table
|
|
npx knex migrate:latest --env development
|
|
npx knex migrate:rollback --env development |