Skip to content

korvised/go-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres

# Install Postgres in docker
# Access psql command on docker
docker exec -it postgres12 psql -U root
# list database
\l
# Create Database
CREATE DATABASE ecommerce;
# Drop Database
DROP DATABASE ecommerce;

Migration

# Create migrate file version [current directory must in pkg/databases/migrations]
migrate create -ext sql -seq initial
migrate create -ext sql -seq seed
# Migrate up
migrate -path db/migration -database "postgres://root:root@localhost:5432/ecommerce?sslmode=disable" -verbose up
# Migrate Down
migrate -path db/migration -database "postgres://root:root@localhost:5432/ecommerce?sslmode=disable" -verbose down

About

go-ecommerce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages