4.4.2 • Published 3 years ago
ldpos-knex-dal v4.4.2
ldpos-pg-dal
Postgres Data Access Layer for LDPoS.
Install docker
- Install docker-engine or docker-desktop
- Make sure docker command is available on the path.
Starting postgres
- Run
yarn start:db
to start postgres instance inside docker - Type
ctrl+c
,yarn stop:db
to stop & remove old db instance.
Starting pgadmin
- Run
yarn start:pgadmin
- Visit
localhost:8081
for pgadmin interface. - Login using creds specified in
docker-compose.yml
file under pgadmin service. - Click
Add New Server
-> General Tab -> Name = Test-Server - Click
Connection
tab -> Host name/address = postgres_db -> Port = 5432 -> Maintenance database = neutral - Copy creds for login from
docker-compose.yml
file under db service
Working with database migrations
- Create migration using
yarn migrate:make migrration_name
e.g.yarn migrate:make create_table_table_name
- Set migration names descriptive, follow
snake case
for migration name and table names (column names can be kept camelCase). - To run migration against db, run
yarn migrate
- To rollback migration
yarn migrate:rollback
Creating seeds
- Create migration using
yarn seed:make seed_name
e.g.yarn seed:make accounts
- follow
snake case
for seeds and seed name is usually table name. - To run seeds against db, run
yarn seed
4.4.2
3 years ago
4.4.1
3 years ago
4.4.0
3 years ago
4.3.0
3 years ago
3.0.1
3 years ago
4.1.0
3 years ago
4.0.1
3 years ago
4.0.0
3 years ago
4.2.0
3 years ago
4.1.1
3 years ago
3.0.0
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.0
3 years ago
1.2.1
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.4
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago